[Vuejs]-ASP.NET Core 'The oauth state was missing or invalid' while redirecting from GoogleAPI

0👍

It seems an issue related with Google+ shut down..

To ASP.NET Core 2.x try the workaround explained in https://github.com/aspnet/AspNetCore/issues/6486

   services.AddAuthentication().AddGoogle(o => {
            o.ClientId = _configuration["CLIENT_ID"];
            o.ClientSecret = _configuration["CLIENT_SECRET"];
            o.UserInformationEndpoint = "https://www.googleapis.com/oauth2/v2/userinfo";
            o.ClaimActions.Clear();
            o.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "id");
            o.ClaimActions.MapJsonKey(ClaimTypes.Name, "name");
            o.ClaimActions.MapJsonKey(ClaimTypes.GivenName, "given_name");
            o.ClaimActions.MapJsonKey(ClaimTypes.Surname, "family_name");
            o.ClaimActions.MapJsonKey("urn:google:profile", "link");
            o.ClaimActions.MapJsonKey(ClaimTypes.Email, "email");
        });

Leave a comment