summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--lib/openid_service_resolver.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/openid_service_resolver.cc b/lib/openid_service_resolver.cc
index 5f82955..505e5b2 100644
--- a/lib/openid_service_resolver.cc
+++ b/lib/openid_service_resolver.cc
@@ -246,3 +246,2 @@ namespace opkele {
throw opkele::failed_lookup(OPKELE_CP_ "no OpenID service for XRI found");
- return auth_info;
}else{
@@ -273,3 +272,3 @@ namespace opkele {
if(html_SEP.xrd_URI.empty())
- throw opkele::failed_lookup(OPKELE_CP_ "no OpenID service discovered");
+ throw opkele::failed_lookup(OPKELE_CP_ "no OpenID 1.0 service discovered");
auth_info.auth_SEP = html_SEP;
@@ -281,12 +280,17 @@ namespace opkele {
}
- return auth_info;
}else{
discover_service(xrds_location);
- if(auth_info.auth_SEP.xrd_Type.empty())
- throw opkele::failed_lookup(OPKELE_CP_ "no OpenID service found in Yadis document");
- if(auth_info.canonical_id.empty())
+ if(auth_info.auth_SEP.xrd_Type.empty()) {
+ if(html_SEP.xrd_URI.empty())
+ throw opkele::failed_lookup(OPKELE_CP_ "no OpenID 1.0 service discovered");
+ auth_info.auth_SEP = html_SEP;
+ auth_info.auth_SEP.xrd_Type.clear(); auth_info.auth_SEP.xrd_Type.insert( STURI_OPENID10 );
auth_info.canonical_id = canonicalized_id;
- return auth_info;
+ }else{
+ if(auth_info.canonical_id.empty())
+ auth_info.canonical_id = canonicalized_id;
+ }
}
}
+ return auth_info;
}