I am using the GoogleOAuth2AuthenticationOptions class for authentication in my MVC5 Web App (SPA Template). Given below is the code
var g = new GoogleOAuth2AuthenticationOptions
{
ClientId = "clientid",
ClientSecret = "secret",
//CallbackPath="",
Provider = new GoogleOAuth2AuthenticationProvider
{
OnAuthenticated = async ctx =>
{
ctx.Identity.AddClaim(new Claim("urn:tokens:google:accesstoken", ctx.AccessToken));
}
}
};
// restrict the retrieved information to just signin information
g.Scope.Add("openid");
app.UseGoogleAuthentication(g);
The token I get is something like this
ya29.LgAibra6cNLEKCEAAADLJxUO ...
Go to the complete details ...