forked from palavilli-godaddy/oneid-php-sdk
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from OneID/doc_1
Doc 1 is ready for integration
- Loading branch information
Showing
6 changed files
with
162 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"API_KEY": "S7nB18z6DrM6RypXFsTxrg==", "API_ID": "052b0422-f23e-4e64-9e72-d6d3a45635b5"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
require("oneid.php"); | ||
|
||
$response = OneID_Response(); | ||
// This function handles validation of | ||
// the response from OneID and returns an | ||
// array of attributes for the user. | ||
|
||
session_start(); | ||
|
||
if(OneID_IsSuccess($response)) { | ||
// here you do what you need to link the OneID with the current user. | ||
$_SESSION['email'] = $response['attr']['personal_info']['email']; | ||
$_SESSION['OneID'] = $response['uid']; | ||
} else { | ||
// if it fails, clear whatever link may have been set previously | ||
unset($_SESSION['OneID']); | ||
unset($_SESSION['email']); | ||
$_SESSION=array_values($_SESSION); | ||
} | ||
|
||
// return the redirect to the next page | ||
|
||
echo OneID_Redirect('account.php',$response); | ||
|
||
// OneID_redirect will send the browser to the next page and pass any errorcodes from authentication and verification back to the OneID client. | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters