summaryrefslogtreecommitdiffstats
path: root/examples/consumer/finish_auth.php
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-03-30 18:34:20 +0000
committertailor <cygnus@janrain.com>2007-03-30 18:34:20 +0000
commit9c5e04d69400eabb9d2d12a6162d9b8e10c7ac2d (patch)
treef11a37cc94a1f405f33c061126a047f6443e99f1 /examples/consumer/finish_auth.php
parentd2793330df45cbba9948266d27ef51a928e47837 (diff)
downloadphp-openid-9c5e04d69400eabb9d2d12a6162d9b8e10c7ac2d.zip
php-openid-9c5e04d69400eabb9d2d12a6162d9b8e10c7ac2d.tar.gz
php-openid-9c5e04d69400eabb9d2d12a6162d9b8e10c7ac2d.tar.bz2
[project @ Update example consumer to use SReg API]
Diffstat (limited to 'examples/consumer/finish_auth.php')
-rw-r--r--examples/consumer/finish_auth.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/examples/consumer/finish_auth.php b/examples/consumer/finish_auth.php
index 64655a3..c4285d5 100644
--- a/examples/consumer/finish_auth.php
+++ b/examples/consumer/finish_auth.php
@@ -32,14 +32,20 @@ function run() {
$success .= ' (XRI CanonicalID: '.$response->endpoint->canonicalID.') ';
}
- $sreg = $response->extensionResponse('sreg', true);
+ $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);
+
+ $sreg = $sreg_resp->contents();
if (@$sreg['email']) {
$success .= " You also returned '".$sreg['email']."' as your email.";
}
- if (@$sreg['postcode']) {
- $success .= " Your postal code is '".$sreg['postcode']."'";
+ if (@$sreg['nickname']) {
+ $success .= " Your nickname is '".$sreg['nickname']."'.";
+ }
+
+ if (@$sreg['fullname']) {
+ $success .= " Your fullname is '".$sreg['fullname']."'.";
}
}