diff options
Diffstat (limited to 'examples/consumer/finish_auth.php')
-rw-r--r-- | examples/consumer/finish_auth.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/consumer/finish_auth.php b/examples/consumer/finish_auth.php new file mode 100644 index 0000000..d03a87f --- /dev/null +++ b/examples/consumer/finish_auth.php @@ -0,0 +1,33 @@ +<?php + +require_once "common.php"; +session_start(); + +// Retrieve the token from the session. +$token = $_SESSION['openid_token']; + +// Complete the authentication process using the server's response. +list($status, $info) = $consumer->completeAuth($token, $_GET); + +$openid = null; + +// React to the server's response. $info is the OpenID that was +// tried. +if ($status != Auth_OpenID_SUCCESS) { + print sprintf("Verification of %s failed.", $info); + exit(0); +} + +// The OpenID authentication either succeeded or was cancelled by the +// user. +if ($info) { + // This means the authentication succeeded. + $openid = $info; + print sprintf("You have successfully verified %s as your identity.", + $openid); +} else { + // Cancelled. + print 'Verification cancelled.'; +} + +?>
\ No newline at end of file |