ASP.NET Core Web App with Google OAuth2 sign in

137 Views Asked by At

I've created a Asp.Net Core 2.1 Web App with a MySql db running on Ubuntu 16.04.

I've followed the basic tutorial from Microsoft docs to setup Google OAuth and it works perfectly when I run it locally in debug. However it does not seem to work when I try to access it from a ddns url, I don't get the Google signin page. My environment looks like this:

  1. Web app locally on a laptop at home behind my router. Nginx setup to forward traffic on port 80 to the web app: All port 80 traffic routed to http://localhost:5000
  2. Router setup with no-ip ddns and port forwarding to for all traffic from http://a.ddns.net:8081 to the local laptop on port 80
  3. I have to note here that without Google OAuth everyting works and I get to my web app.
  4. When I try to access the app from a.ddns.net:8081 it opens the Login page but when I click on "Sign in with Google", I got a few errors, one was that the Authorized Redirect URI was not the same as the one saved on my account. I played around with a few variations and got to a point where I get a 500 Internal server error, I don't know where this is happening?

Can anybody help with my setup? Is it just my Authorized Redirect URI that is wrong or is it something else?

Thanks

Update: This is what my OAuth settings look like. I did not orignally have an Authorized Javascript origin, just added that now: enter image description here

0

There are 0 best solutions below