Sign in with Google doesn't work

https://www.inaturalist.org/auth/google_oauth2 throws “404 page not found” error.

Step 1: Go to inaturalist home page
Step2: Click on “Sign in with Google” option

I tried both Firefox and Chrome browsers on Windows with same result.

I used to have this problem using Facebook login on iNat all the time. Turns out this happens when you don’t let the page you login from fully load. Since then, when I need to log in somewhere (not often, as it stays logged mostly), I wait for some time and it never fails.

2 Likes

I’m not seeing this in FF and Chrome on my Mac. I click on Sign in with Google at https://www.inaturalist.org/login and I’m taken to this page:

I choose my Google account, allow iNat to access my Google Account and then I’m in. Have you tried turning off extensions? Might not help but always worth a shot.

Thanks! You are right.

It seems if I give enough time to load the https://www.inaturalist.org and https://www.inaturalist.org/login pages, then Google login works as expected.

However, if I click “Sign in with Google” button before all the bells and whistles get loaded, I run into this page not found error.

There seem to be some sort of race condition.

Looking at the logs, a successful request has _method and authenticity_token in the Cookie part of HTTP request.

An unsuccessful request doesn’t have those two in the Cookie.

I am not an expert, but my best guess is some JavaScript or Ruby on Rails code doesn’t get executed in the “fast path”, leading to failed token generation and eventual oauth2 failure.

I am sure dev team will be able to confirm if authenticity_token has got something to do with this error or is a red-herring.

1 Like

Will add to my report.

2 Likes

Platform (Android, iOS, Website): Android

App version number, if a mobile app issue (shown under Settings or About):

Browser, if a website issue (Firefox, Chrome, etc) : Android Chrome 86.0.4240.185 (but previous versions of Chrome had same issue)

URLs (aka web addresses) of any relevant observations or pages: https://www.inaturalist.org/auth/google_oauth2

Description of problem (please provide a set of steps we can use to replicate the issue, and make as many as you need.):

Step 1: Click “sign in”

Step 2: Click “sign in w Google”

Step 3: Browser may or may not redirect to the 404 not found page linked above when I click the Google button. Clicking the G button sometimes takes me to the correct page, but other times it does not. Thus I have to usually repeatedly press the button several times before I log in successfully. Sometimes one click may return a 404 and another click will return the correct signin page even when I didn’t refresh, so evidently one button is somehow taking me to two different URLs.

This appears to be the same problem as the one the OP posted in the below URL.

https://forum.inaturalist.org/t/not-able-to-log-in/6800/18

@tiwane It seems that I had jumped to conclusions.

  1. The problem never actually ceased. I assumed it ceased because some time had gone by without a failed login.
  2. The “new tab” method doesn’t actually seem to work, I may have been “superstitious”.

(moved to this topic)

Have you waited a few seconds before clicking sign in with Google? Would be interested to see if you’re getting the same results as @googleuser6 above.

@tiwane I’ve logged in several dozen times as an experiment, and whenever I wait several seconds after the page loads I have never had a single 404 page pop up.

2 Likes

Thanks for checking that out! We’re working on a fix, should be out next week.

OK, you now shouldn’t be able to click on Sign in with Google until all the necessary code has been loaded.

2 Likes