summaryrefslogtreecommitdiffstats
path: root/Auth/OpenID/Consumer.php
diff options
context:
space:
mode:
Diffstat (limited to 'Auth/OpenID/Consumer.php')
-rw-r--r--Auth/OpenID/Consumer.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/Auth/OpenID/Consumer.php b/Auth/OpenID/Consumer.php
index 0c5ce82..8f12386 100644
--- a/Auth/OpenID/Consumer.php
+++ b/Auth/OpenID/Consumer.php
@@ -850,8 +850,15 @@ class Auth_OpenID_GenericConsumer {
"Missing required field openid.identity");
}
+ $to_match_1_0 = $to_match->copy();
+ $to_match_1_0->type_uris = array(Auth_OpenID_TYPE_1_0);
+
$result = $this->_verifyDiscoverySingle($endpoint, $to_match);
+ if (is_a($result, 'Auth_OpenID_TypeURIMismatch')) {
+ $result = $this->_verifyDiscoverySingle($endpoint, $to_match_1_0);
+ }
+
if (is_a($result, 'Auth_OpenID_FailureResponse')) {
return $result;
} else {
@@ -865,7 +872,7 @@ class Auth_OpenID_GenericConsumer {
// present in the discovered endpoint.
foreach ($to_match->type_uris as $type_uri) {
if (!$endpoint->usesExtension($type_uri)) {
- return new Auth_OpenID_FailureResponse($endpoint,
+ return new Auth_OpenID_TypeURIMismatch($endpoint,
"Required type ".$type_uri." not present");
}
}
@@ -1699,6 +1706,12 @@ class Auth_OpenID_FailureResponse extends Auth_OpenID_ConsumerResponse {
}
/**
+ * A specific, internal failure used to detect type URI mismatch.
+ */
+class Auth_OpenID_TypeURIMismatch extends Auth_OpenID_FailureResponse {
+}
+
+/**
* A response with a status of Auth_OpenID_CANCEL. Indicates that the
* user cancelled the OpenID authentication request. This has two
* relevant attributes: