Closed saviokmua closed 4 months ago
On Google console credentials I added the next Authorized redirect URIs:
1) http://localhost:3000/users/auth/google_oauth2/callback?kind=sign_in 2) http://localhost:3000/users/auth/google_oauth2/callback?kind=sign_up 3) http://localhost:3000/users/auth/google_oauth2/callback
when I used http://localhost:3000/users/auth/google_oauth2/callback all works ok!
http://localhost:3000/users/auth/google_oauth2/callback
but when I tried to use callback http://localhost:3000/users/auth/google_oauth2/callback?kind=sign_in I received the next issue:
http://localhost:3000/users/auth/google_oauth2/callback?kind=sign_in
D, [2023-04-11T09:03:21.241145 #21150] DEBUG -- omniauth: (google_oauth2) Callback phase initiated. E, [2023-04-11T09:03:21.419771 #21150] ERROR -- omniauth: (google_oauth2) Authentication failure! invalid_credentials: OAuth2::Error, redirect_uri_mismatch: Bad Request { "error": "redirect_uri_mismatch", "error_description": "Bad Request" }
could you help please, what I'm doing wrong?
omniauth-google-oauth2 (1.1.1) omniauth-oauth2 (1.8.0) omniauth (2.1.1)
Seems they don't like custom parameters in the url. Perhaps you can pass that data in the state param?
On Google console credentials I added the next Authorized redirect URIs:
1) http://localhost:3000/users/auth/google_oauth2/callback?kind=sign_in 2) http://localhost:3000/users/auth/google_oauth2/callback?kind=sign_up 3) http://localhost:3000/users/auth/google_oauth2/callback
when I used
http://localhost:3000/users/auth/google_oauth2/callback
all works ok!but when I tried to use callback
http://localhost:3000/users/auth/google_oauth2/callback?kind=sign_in
I received the next issue:could you help please, what I'm doing wrong?