summaryrefslogtreecommitdiffabout
Unidiff
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 {
246 throw opkele::failed_lookup(OPKELE_CP_ "no OpenID service for XRI found"); 246 throw opkele::failed_lookup(OPKELE_CP_ "no OpenID service for XRI found");
247 return auth_info;
248 }else{ 247 }else{
@@ -273,3 +272,3 @@ namespace opkele {
273 if(html_SEP.xrd_URI.empty()) 272 if(html_SEP.xrd_URI.empty())
274 throw opkele::failed_lookup(OPKELE_CP_ "no OpenID service discovered"); 273 throw opkele::failed_lookup(OPKELE_CP_ "no OpenID 1.0 service discovered");
275 auth_info.auth_SEP = html_SEP; 274 auth_info.auth_SEP = html_SEP;
@@ -281,12 +280,17 @@ namespace opkele {
281 } 280 }
282 return auth_info;
283 }else{ 281 }else{
284 discover_service(xrds_location); 282 discover_service(xrds_location);
285 if(auth_info.auth_SEP.xrd_Type.empty()) 283 if(auth_info.auth_SEP.xrd_Type.empty()) {
286 throw opkele::failed_lookup(OPKELE_CP_ "no OpenID service found in Yadis document"); 284 if(html_SEP.xrd_URI.empty())
287 if(auth_info.canonical_id.empty()) 285 throw opkele::failed_lookup(OPKELE_CP_ "no OpenID 1.0 service discovered");
286 auth_info.auth_SEP = html_SEP;
287 auth_info.auth_SEP.xrd_Type.clear(); auth_info.auth_SEP.xrd_Type.insert( STURI_OPENID10 );
288 auth_info.canonical_id = canonicalized_id; 288 auth_info.canonical_id = canonicalized_id;
289 return auth_info; 289 }else{
290 if(auth_info.canonical_id.empty())
291 auth_info.canonical_id = canonicalized_id;
292 }
290 } 293 }
291 } 294 }
295 return auth_info;
292 } 296 }