Commit 44d22fc8 authored by Gábor Hojtsy's avatar Gábor Hojtsy

#156886 by edgauthier: fix OpenID delegation

parent 7d8c8d72
......@@ -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';
}
......
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment