summaryrefslogtreecommitdiff
path: root/modules/openid/openid.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/openid/openid.module')
-rw-r--r--modules/openid/openid.module13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/openid/openid.module b/modules/openid/openid.module
index a0bc93324..d5727954a 100644
--- a/modules/openid/openid.module
+++ b/modules/openid/openid.module
@@ -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';
}