简体   繁体   English

Wordpress是否有可用的Devise / Omniauth / Oauth2接口?

[英]Is there a working Devise/Omniauth/Oauth2 interface with Wordpress?

I'm trying to use Wordpress to authenticate my Rails application users with the following Omniauth plugin: 我正在尝试使用Wordpress通过以下Omniauth插件对我的Rails应用程序用户进行身份验证:

https://github.com/jwickard/omniauth-wordpress-oauth2-plugin https://github.com/jwickard/omniauth-wordpress-oauth2-plugin

I've followed the instructions carefully, and duplicated his example, but it doesn't work. 我已经严格按照说明进行操作,并复制了他的示例,但是它不起作用。 Which is really surprising, because there's just not that much to it. 这真的很令人惊讶,因为它没有那么多。 However, I've found several threads on here like this one, that talk about the same problem I have: 但是,我在这里发现了几个这样的线程,它们讨论了我遇到的相同问题:

Devise, OmniAuth & Facebook: "Not found. Authentication passthru." Devise,OmniAuth和Facebook:“未找到。身份验证通过。”

When I click the "Sign in with Wordpress" (which is automatically inserted in my Devise sign-in page), I simply get a 404, with "Not found. Authentication passthru," which is a stub response for the passthru method in the Devise sources. 当我单击“使用Wordpress登录”(这会自动插入到我的Devise登录页面中)时,我得到的只是一个404,带有“未找到。身份验证通过”,这是对passthru方法的存根响应。设计来源。 Routes rake just fine, and look like all the examples. 路线很好,看起来像所有示例。 I've restarted the server dozens of times. 我已经重启服务器数十次了。

Despite several attempts to set site: and authorization_url: in the client_options , in both my devise config, and the plugin sources directly, my app never redirects to my Wordpress site. 尽管在我的设计配置和插件源中都在client_options设置了site:authorization_url:client_options都很多,但我的应用程序从未重定向到我的Wordpress网站。 I've got about 10 hours into screwing around with this, and I don't know what's supposed to be responsible for actually sending me to the site to DO the authentication. 我花了大约10个小时来解决这个问题,但我不知道实际将我发送到站点进行身份验证应该由谁负责。 Further complicating figuring this out is that almost every reference I can find to redirection in this sort of scenario is about the callback to my Rails site, after the authentication is done. 使这种情况变得更加复杂的是,在这种情况下,我能找到的几乎所有重定向参考都与身份验证完成后回调到我的Rails站点有关。 I can never get that far. 我永远也走不了那么远。

There's a lot of confusing references to this problem on SO and the internet at large. 在SO和整个Internet上,很多关于此问题的令人困惑的参考。 There's some talk about making a "real" passthru or action_missing method in my OmniauthCallbacksController, but that seems to be outdated information. 有人谈论在我的OmniauthCallbacksController中制作一个“真实的” passthruaction_missing方法,但这似乎已经过时了。 There's a lot of talk about making sure that I've defined the omniauth_providers in my User model, and I've tried it with and without, but that's not in any of the documentation about this plugin. 关于确保在用户模型中定义omniauth_providers的讨论很多,无论有没有,我都尝试过,但是关于此插件的任何文档中都没有。

I've been trying to look at the plugin's strategy file, and it just doesn't seem that different than other Oauth2 plugins for Facebook, Google, or whatever, that I've been reviewing. 我一直在尝试查看该插件的策略文件,但似乎与我一直在审查的Facebook,Google或其他任何Oauth2插件没什么不同。 It seems like there's a very simple thing I need to set in order to make this all work, but I can't find it, and I've run out of ideas on how to track it down. 为了使这一切都能正常进行,似乎需要设置一个非常简单的东西,但是我找不到它,并且我已经没有足够的想法来进行追踪了。 The plugin was last updated about 5 years ago. 该插件的最新更新时间约为5年。 Does anyone still use this with modern versions of Devise, Omniauth, and Wordpress? 有人还会在Devise,Omniauth和Wordpress的现代版本中使用它吗? If so, is there a clue you can give me to make it work? 如果是这样,您能给我个提示使其工作吗?

I finally started tracing through the gem, and found where it was failing. 我终于开始跟踪宝石,并找到失败的地方。 As I searched on those further problems, I finally figured out that there were about 25 forks of this gem, and many of them addressed the problem. 当我搜索这些进一步的问题时,我最终发现该宝石大约有25个分叉,其中许多都解决了该问题。 I used this particular one: https://github.com/bkno/omniauth-wordpress-oauth2-plugin 我使用了这个特定的网址https : //github.com/bkno/omniauth-wordpress-oauth2-plugin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带有devise和omniauth的Google oauth2被视为失败 - Google oauth2 with devise and omniauth processed as failure Facebook,LinkedIn和Google的Oauth2登录已停止使用Devise和Omniauth,但仍适用于LinkedIn和Twitter - Oauth2 Login for Facebook, Linkedin and Google Stopped Working with Devise and Omniauth, But Still Works for LinkedIn and Twitter 来自omniauth的双重请求(设计,自定义策略,oauth2) - double request from omniauth (devise, custom strategy, oauth2) ClassLink Devise OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected - ClassLink Devise OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected OmniAuth Oauth2无法将Instagram用户帐户持久化为用户模型(Devise) - OmniAuth Oauth2 not persisting Instagram user account to User model (Devise) Oauth2提供商(门卫?)是Oauth2消费者(Devise + OmniAuth)的登录用户 - Oauth2 provider (Doorkeeper?) being an Oauth2 consumer (Devise+OmniAuth) for login Omniauth与Linkedin Oauth2 - Omniauth with Linkedin Oauth2 Rails Oauth 设计 Omniauth - Rails Oauth Devise Omniauth Ruby on Rails设计Oauth-facebook OmniAuth :: Strategies :: OAuth2 :: CallbackError - Ruby on Rails Devise Oauth-facebook OmniAuth::Strategies::OAuth2::CallbackError 在OmniAuth中处理OmniAuth :: Strategies :: OAuth2 :: CallbackError - Handling OmniAuth::Strategies::OAuth2::CallbackError in OmniAuth
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM