【问题标题】:omniauth custom request phase formomn​​iauth 自定义请求阶段表单
【发布时间】:2013-08-11 17:38:22
【问题描述】:

我正在尝试编写自定义 OmniAuth 策略。这需要提示输入用户名和密码。 https://github.com/intridea/omniauth/wiki/Strategy-Contribution-Guide 是一个有用的开始,我目前正在使用文档中提到的 OmniAuth::Form 方法,但现在我想实现一个更好的登录表单。

文档说OmniAuth has a very simple form builder built into it so that you can easily prompt the user for information that's needed for your strategy. These forms are really not meant to be shown to end users but rather work as a stopgap for developers until they implement custom forms...,但没有说明如何实现自定义表单。

我该怎么做?有好的例子吗?

【问题讨论】:

    标签: ruby-on-rails devise omniauth


    【解决方案1】:

    根据OmniAuth wiki,您只需要在指定要使用的Rack中间件时提供:form选项即可:

    use OmniAuth::Builder do
      provider :example, :form => SessionsController.action(:new)
    end
    

    【讨论】:

      猜你喜欢
      • 2012-01-06
      • 2011-10-06
      • 2014-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多