Exemplo n.º 1
0
 public override bool TryGetOpenIdResponse(out IAuthenticationResponse openIdResponse)
 {
     openIdResponse = openIdRelyingParty.GetResponse();
     if (openIdResponse.IsNull())
     {
         return false;
     }
     return true;
 }
Exemplo n.º 2
0
 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");
     }
 }