-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathauthhandler.php
More file actions
42 lines (40 loc) · 1.34 KB
/
authhandler.php
File metadata and controls
42 lines (40 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<? ob_start(); ?>
<?php
if(!isset($_SESSION)) {
session_start();
}
include("classes/adfsbridge.php");
include("classes/adfsuserdetails.php");
include("conf/adfsconf.php");
?>
<?php if(!isset($_REQUEST['wa'])) : ?>
Expected context parameter is not provided.
<?php else : ?>
<?php if($_REQUEST['wa'] == 'wsignin1.0') : ?>
<?php
$adfs = new AdfsBridge();
try {
$userDetails = $adfs->getAdfsSignInResponse(
AdfsConf::getInstance(),
$_REQUEST['wa'],
$_REQUEST['wresult'],
$_REQUEST['wctx']);
// Set the user details in session.
$_SESSION['AdfsUserDetails'] = serialize($userDetails);
// Expect return url in wctx (set by authform.php)
header('Location: '. $_REQUEST['wctx']);
} catch (Exception $e) {
printf('Message: '.$e->getMessage());
}
?>
<?php endif; ?>
<?php if($_REQUEST['wa'] == 'wsignout1.0') : ?>
<?php
if (isset($_SESSION['AdfsUserDetails'])) {
unset($_SESSION['AdfsUserDetails']);
}
exit;
?>
<?php endif; ?>
<?php endif; ?>
<? ob_flush(); ?>