3

我正在尝试编写自定义 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...但它没有说明如何实施自定义表单。

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

4

1 回答 1

2

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

use OmniAuth::Builder do
  provider :example, :form => SessionsController.action(:new)
end
于 2014-02-17T20:47:42.907 回答