AuthBridge.Protocols.OAuth.GoogleHandler.ProcessSignInResponse C# (CSharp) Method

ProcessSignInResponse() public method

public ProcessSignInResponse ( string realm, string originalUrl, System.Web.HttpContextBase httpContext ) : ClaimsIdentity
realm string
originalUrl string
httpContext System.Web.HttpContextBase
return System.Security.Claims.ClaimsIdentity
        public override ClaimsIdentity ProcessSignInResponse(string realm, string originalUrl, HttpContextBase httpContext)
        {
            var client = new GoogleOAuthClient(_clientId, _clientSecret);
            AuthenticationResult result;
            try
            {
                result = client.VerifyAuthentication(httpContext, this.MultiProtocolIssuer.ReplyUrl);
            }
            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"])
            };

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