0

When trying to implement google sso I am getting the 403 forbidden error. I have been following tutorial exactly as shown here and have even pulled the repo. https://medium.com/c-sharp-progarmming/asp-net-core-google-authentication-4c0aa8feebbc

I've added my client id and secret from google, and updated authorized uri, but I am still get error "HttpRequestException: An error occurred when retrieving Google user information (Forbidden). Please check if the authentication information is correct and the corresponding Google+ API is enabled." Not sure what else I can try.

my service set up looks like so

 services.AddAuthentication()
                .AddGoogle(options =>
                {
                   options.ClientId = "censored for privacy.apps.googleusercontent.com";
                   options.ClientSecret = "censored for privacy";
                });

this client Id and secret is definitely valid as I am using it for a app I wrote in python and the google sso works fine there. My code is exact copy of github repo https://github.com/Pritom300/Google-Auth, which you can pull from article, with ports and client id / secret changed. My db has been successfully initialized. Any help would be greatly appreciated been debugging this for 2 days with no luck. I am able to reach google login page but upon signing in will fail with forbidden error so I'm guessing something is missing from config.

nightwolf555
  • 327
  • 1
  • 14

0 Answers0