summaryrefslogtreecommitdiffstats
path: root/examples/consumer/finish_auth.php
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-03-10 00:40:35 +0000
committertailor <cygnus@janrain.com>2007-03-10 00:40:35 +0000
commit338d0a3cc020328d349faff0c5d87a5ff6459f6e (patch)
treedded8e19bc3ff0b5035f02a73c8ab0e68ed7c361 /examples/consumer/finish_auth.php
parentc3fc5ffa72ceee8aedd043e718297f50eecc4426 (diff)
downloadphp-openid-338d0a3cc020328d349faff0c5d87a5ff6459f6e.zip
php-openid-338d0a3cc020328d349faff0c5d87a5ff6459f6e.tar.gz
php-openid-338d0a3cc020328d349faff0c5d87a5ff6459f6e.tar.bz2
[project @ Comments in example consumer]
Diffstat (limited to 'examples/consumer/finish_auth.php')
-rw-r--r--examples/consumer/finish_auth.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/consumer/finish_auth.php b/examples/consumer/finish_auth.php
index b674155..64655a3 100644
--- a/examples/consumer/finish_auth.php
+++ b/examples/consumer/finish_auth.php
@@ -6,16 +6,21 @@ session_start();
function run() {
$consumer = getConsumer();
- // Complete the authentication process using the server's response.
+ // Complete the authentication process using the server's
+ // response.
$response = $consumer->complete($_GET);
+ // Check the response status.
if ($response->status == Auth_OpenID_CANCEL) {
// This means the authentication was cancelled.
$msg = 'Verification cancelled.';
} else if ($response->status == Auth_OpenID_FAILURE) {
+ // Authentication failed; display the error message.
$msg = "OpenID authentication failed: " . $response->message;
} else if ($response->status == Auth_OpenID_SUCCESS) {
- // This means the authentication succeeded.
+ // This means the authentication succeeded; extract the
+ // identity URL and Simple Registration data (if it was
+ // returned).
$openid = $response->identity_url;
$esc_identity = htmlspecialchars($openid, ENT_QUOTES);