AuthBridge.Protocols.OpenID.YahooHandler.ProcessSignInResponse C# (CSharp) Метод

ProcessSignInResponse() публичный Метод

public ProcessSignInResponse ( string realm, string originalUrl, System.Web.HttpContextBase httpContext ) : ClaimsIdentity
realm string
originalUrl string
httpContext System.Web.HttpContextBase
Результат ClaimsIdentity
        public override ClaimsIdentity ProcessSignInResponse(string realm, string originalUrl, HttpContextBase httpContext)
        {
            var client = new YahooOpenIdClient();

            AuthenticationResult result;
            try
            {
                result = client.VerifyAuthentication(httpContext);
            }
            catch (WebException wex)
            {
                throw new InvalidOperationException(new StreamReader(wex.Response.GetResponseStream()).ReadToEnd(), wex);
            }

            var claims = new List<Claim>
                {
                    new Claim(System.IdentityModel.Claims.ClaimTypes.NameIdentifier, result.ExtraData["email"])
                };

            foreach (var claim in result.ExtraData)
            {
                claims.Add(new Claim("http://schemas.yahoo.com/" + claim.Key, claim.Value));
            }

            return new ClaimsIdentity(claims, "Yahoo");
        }