public override bool TryGetOpenIdResponse(out IAuthenticationResponse openIdResponse) { openIdResponse = openIdRelyingParty.GetResponse(); if (openIdResponse.IsNull()) { return false; } return true; }
public override OpenIdData ParseOpenIdResponse(IAuthenticationResponse openIdResponse) { if (openIdResponse.IsNull()) { throw new ArgumentException("Invalid open id response"); } //Let us check the response switch (openIdResponse.Status) { case AuthenticationStatus.Authenticated: var openId = openIdResponse.ClaimedIdentifier; var friendlyName = openIdResponse.FriendlyIdentifierForDisplay; return new OpenIdData() {FriendlyName = friendlyName, OpenId = openId}; break; default: throw new ArgumentException("Invalid open id"); } }