Skip to content

Commit

Permalink
XRDS 1.1 types
Browse files Browse the repository at this point in the history
  • Loading branch information
brendonh committed Sep 18, 2009
1 parent bcc8fa6 commit e3c779a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/openid.erl
Expand Up @@ -29,9 +29,15 @@ extract_authreq(XRDS) ->
Req -> Req
end.

authreq_by_opid(XRDS) ->
case find_service(XRDS#xrds.services, "http://specs.openid.net/auth/2.0/server") of
none -> none;
authreq_by_opid(XRDS) ->
authreq_by_opid(XRDS, ["http://specs.openid.net/auth/2.0/server",
"http://openid.net/server/1.1",
"http://openid.net/server/1.0"]).

authreq_by_opid(_, []) -> none;
authreq_by_opid(XRDS, [Type|Rest]) ->
case find_service(XRDS#xrds.services, Type) of
none -> authreq_by_opid(XRDS, Rest);
Service -> build_authReq(XRDS, Service, {2,0})
end.

Expand Down Expand Up @@ -61,7 +67,7 @@ authreq_by_claimed_id(XRDS, [{Type,Version}|Rest]) ->

build_authReq(XRDS, Service, Version) ->
[URL|_] = Service#xrdService.uris,
#authReq{opURL=URL, version={2,0},
#authReq{opURL=URL, version=Version,
claimedID=XRDS#xrds.claimedID,
localID=Service#xrdService.localID}.

Expand Down

0 comments on commit e3c779a

Please sign in to comment.