gpt4 book ai didi

ruby-on-rails - Omniauth:回调未触发,返回 "invalid credentials"失败

转载 作者:行者123 更新时间:2023-12-04 08:15:04 25 4
gpt4 key购买 nike

我的 Rails 应用程序中使用 Omniauth gem 实现的 facebook 身份验证最近停止工作。

问题是应该由回调使用的 Controller 操作没有被触发,并且进程立即跳到失败并显示“无效凭据”消息。

日志:

Started GET "/auth/facebook" for ::ffff:127.0.0.1 at 2017-03-29 11:12:29 +0200
Started GET "/auth/facebook/callback?code=<<code>>&state=<<state>" for ::ffff:127.0.0.1 at 2017-03-29 11:12:30 +0200
Started GET "/auth/failure?message=invalid_credentials&origin=<<origin>>&strategy=facebook" for ::ffff:127.0.0.1 at 2017-03-29 11:12:31 +0200
Started GET "/login" for ::ffff:127.0.0.1 at 2017-03-29 11:12:31 +0200
Processing by UserSessionsController#new as HTML

路线:

  match "/auth/failure" => redirect("/login"), :via => [:get, :post]
match '/auth/:provider/callback' => 'user_sessions#create_omniauth', :via => [:get, :post]
match '/auth/:provider/disconnect' => 'user_sessions#destroy_omniauth', :as => :destroy_auth, :via => :delete

任何想法可能是错误的?

编辑:我在 Google 授权方面遇到了同样的问题。

最佳答案

将 gems 更新到最新版本(omniauth 1.6.1 和 omniauth-facebook 4.0.0):

bundle update omniauth
bundle update omniauth-facebook

解决了这个问题。我将此留作将来引用。

编辑:

同样的事情适用于谷歌授权:

bundle update omniauth-google-oauth2

关于ruby-on-rails - Omniauth:回调未触发,返回 "invalid credentials"失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43089426/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com