0

我尝试在最后阶段通过 Google 和 Devise Gem 进行身份验证,我收到一条消息:无法从 Google 对您进行身份验证,因为 user@gmail.com 未经授权。因此,我无法登录

日志:

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

图片

4

1 回答 1

0

看起来您可能需要为您的应用创建 Google 授权凭据。看看https://developers.google.com/identity/sign-in/web/sign-in#create_authorization_credentials

于 2021-07-29T03:21:45.953 回答