#156886 by edgauthier: fix OpenID delegation

6.x
Gábor Hojtsy 2007-10-15 09:40:42 +00:00
parent 7d8c8d72f1
commit 44d22fc863
2 changed files with 15 additions and 1 deletions

View File

@ -157,7 +157,18 @@ function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
// Now that there is an association created, move on
// to request authentication from the IdP
$identity = (!empty($services[0]['delegate'])) ? $services[0]['delegate'] : $claimed_id;
// First check for LocalID. If not found, check for Delegate. Fall
// back to $claimed_id if neither is found.
if (!empty($services[0]['localid'])) {
$identity = $services[0]['localid'];
}
else if (!empty($services[0]['delegate'])) {
$identity = $services[0]['delegate'];
}
else {
$identity = $claimed_id;
}
if (isset($services[0]['types']) && is_array($services[0]['types']) && in_array(OPENID_NS_2_0 .'/server', $services[0]['types'])) {
$identity = 'http://openid.net/identifier_select/2.0';
}

View File

@ -65,6 +65,9 @@ function _xrds_cdata(&$parser, $data) {
case 'XRDS/XRD/SERVICE/DELEGATE':
$xrds_current_service['delegate'] = $data;
break;
case 'XRDS/XRD/SERVICE/LOCALID':
$xrds_current_service['localid'] = $data;
break;
}
}