summaryrefslogtreecommitdiffstats
path: root/examples/consumer/finish_auth.php
diff options
context:
space:
mode:
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);