0

I trying to authenticate with Google and Devise Gem at the final stage, I receive a flash message: Could not authenticate you from Google because [email protected] is not authorized. Therefore, I cannot log in

logs:

DEBUG -- omniauth: (google_oauth2) Request phase initiated. Started GET "/users/auth/google_oauth2/callback?state=bfcb81a9dc331af478dcd5ccb3dda620894b0e577d1fabe8&code=4%2F0AX4XfWifE4F2PzgdO28g5GSMPg28WltztgoSpJHfM-CsQl8oplhFAKix-WJZAf9LRREIHw&scope=email+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcontacts.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=0&prompt=none" for ::1 at 2021-07-23 11:59:55 +0300 D, [2021-07-23T11:59:55.042930 #13482] DEBUG -- omniauth: (google_oauth2) Callback phase initiated. Processing by Users::OmniauthCallbacksController#google_oauth2 as HTML Parameters: {"state"=>"bfcb81a9dc331af478dcd5ccb3dda620894b0e577d1fabe8", "code"=>"4/0AX4XfWifE4F2PzgdO28g5GSMPg28WltztgoSpJHfM-CsQl8oplhFAKix-WJZAf9LRREIHw", "scope"=>"email openid https://www.googleapis.com/auth/contacts.readonly https://www.googleapis.com/auth/userinfo.email", "authuser"=>"0", "prompt"=>"none"} Redirected to http://localhost:3000/users/sign_in 

image

3
  • Can you share exact prompt screenshot ? Are you giving [email protected] as an example or are you using exactly this email as test email ? Commented Jul 23, 2021 at 21:39
  • I am using a really existing mail Commented Jul 26, 2021 at 6:33
  • did you figure this out? I have the same issue, my email is in the test emails field on the google console for my app Commented Aug 24, 2023 at 16:49

1 Answer 1

0

It looks like you might need to create Google authorization credentials for your app. Take a look at https://developers.google.com/identity/sign-in/web/sign-in#create_authorization_credentials.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.