Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc1a9bec

Browse files
committed
added the php equivilent of ReceiveSSOToken.aspx.cs
1 parent05ddd20 commitc1a9bec

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
session_start();
3+
ob_start();
4+
5+
//include_once($_SERVER['DOCUMENT_ROOT'].'/ms_sdk/APISample/phpsdk.phar'); // Use PHAR Archive
6+
include_once($_SERVER['DOCUMENT_ROOT'].'/ms_sdk/src/MemberSuite.php');// Use the SRC Directory
7+
8+
include_once('./ConciergeApiHelper.php');
9+
include_once('./config.php');
10+
11+
12+
// Get Private XML Content
13+
$xmlPath = Userconfig::read('SigningcertificatePath');
14+
if (file_exists($xmlPath)) {
15+
$value =file_get_contents($xmlPath);
16+
$rsaXML =mb_convert_encoding($value,'UTF-8','UTF-16LE');
17+
}else {
18+
$_SESSION['loginerr'] ='Signing certificate file does not exists.';
19+
header("location:index.php?error=credentialerror");
20+
exit();
21+
}
22+
23+
$api =newMemberSuite();
24+
$api->accesskeyId = Userconfig::read('AccessKeyId');
25+
$api->associationId = Userconfig::read('AssociationId');
26+
$api->secretaccessId = Userconfig::read('SecretAccessKey');
27+
28+
$helper =newConciergeApiHelper();
29+
if($_SERVER['REQUEST_METHOD'] =='POST') {
30+
$nextUrl =$_POST['NextUrl'];
31+
$returnUrl =$_POST['ReturnUrl'];
32+
$tokenString =$_POST["Token"];
33+
34+
$token =base64_decode($tokenString);
35+
36+
$portalTokenSignature =$helper->DigitalSignature($token,$rsaXML);
37+
$api->digitalsignature =$helper->DigitalSignature($api->portalusername,$rsaXML);
38+
39+
$response =$api->LoginWithToken($tokenString, Userconfig::read('SigningcertificateId'),$portalTokenSignature);
40+
41+
if($response->aSuccess =='false'){
42+
$loginarr =$response->aErrors->bConciergeError->bMessage;
43+
$_SESSION['loginerr'] =$loginarr;
44+
header("location:index.php?error=credentialerror");
45+
exit();
46+
}
47+
48+
$loginResult =$response->aResultValue;
49+
$currentUser =newmsPortalUser($loginResult->aPortalUser);
50+
$individual =newmsIndividual($loginResult->aPortalEntity);
51+
$currentAssociation =newmsAssociation($loginResult->aAssociation);
52+
?>
53+
Successfully validated login from:<br/>
54+
<ul>
55+
<li>id:<?phpecho($currentUser->ID)?></li>
56+
<li>user:<?phpecho($currentUser->Name)?></li>
57+
<li>last login:<?phpecho($currentUser->LastLoggedInAs)?></li>
58+
<li>first name:<?phpecho($currentUser->FirstName)?></li>
59+
<li>last name:<?phpecho($currentUser->LastName)?></li>
60+
<li>email:<?phpecho($currentUser->EmailAddress)?></li>
61+
</ul>
62+
<?php
63+
}
64+
65+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp