I'm running a website that works great on Google Cloud Platform but there is a issue that I'm unable to resolve at code level on my website and I think it is related to GCP.
On the website the users can connect quickly through a Google account, the thing is that it works great only while the website is working on a local server and not while the website is in the cloud.
So far I have read about it a lot and changed a lot of things at the code level and settings but it does not solve the problem, once someone tries to log in through an existing Google account the website fails to read his details and it bring him back to login form page, without even show any error message.
My code so far, In Startup.Auth page:
app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
{
ClientId = "xyz",
ClientSecret = "xyz",
});
In GCP I followed these steps to allow external login on the website:
- Set the callback URL - https://mywebsite.com/signin-google
- Enable the Google+ API
And as I mentioned, this work excelnet on localhost but not when the website on the cloud.
Did I miss any step?