summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/consumer/finish_auth.php5
-rw-r--r--examples/consumer/try_auth.php2
2 files changed, 7 insertions, 0 deletions
diff --git a/examples/consumer/finish_auth.php b/examples/consumer/finish_auth.php
index 5d21456..ea99696 100644
--- a/examples/consumer/finish_auth.php
+++ b/examples/consumer/finish_auth.php
@@ -18,6 +18,11 @@ if ($response->status == Auth_OpenID_CANCEL) {
$success = sprintf('You have successfully verified ' .
'<a href="%s">%s</a> as your identity.',
$esc_identity, $esc_identity);
+ $sreg = $response->extensionResponse('sreg');
+
+ if (@$sreg['email']) {
+ $success .= " You also returned '".$sreg['email']."' as your email.";
+ }
}
include 'index.php';
diff --git a/examples/consumer/try_auth.php b/examples/consumer/try_auth.php
index 7f1355f..f61b2f2 100644
--- a/examples/consumer/try_auth.php
+++ b/examples/consumer/try_auth.php
@@ -30,6 +30,8 @@ if (!$auth_request) {
exit(0);
}
+$auth_request->addExtensionArg('sreg', 'optional', 'email');
+
// Redirect the user to the OpenID server for authentication. Store
// the token for this authentication so we can verify the response.