3

我完全按照此处所示设置了omniauth-password: https ://github.com/namick/omniauth-password

但是,每次我尝试登录时都会收到一个 invalid_credentials 错误。现在,我的数据库中没有用户,所以应该创建它们吧?我有点困惑注册适合这个。

问题是我的控制器甚至没有被调用。这是日志。

(password) Callback phase initiated.
(password) Authentication failure! invalid_credentials encountered.

Started POST "/auth/password/callback" for 127.0.0.1 at 2012-12-05 02:34:05 -0800
  User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."email" = 'asd@asf.comssdf' LIMIT 1


Started GET "/auth/failure?message=invalid_credentials&strategy=password" for 127.0.0.1 at 2012-12-05 02:34:05 -0800
Processing by SessionsController#failure as HTML
  Parameters: {"message"=>"invalid_credentials", "strategy"=>"password"}
  Rendered text template (0.0ms)
Completed 200 OK in 16ms (Views: 15.4ms | ActiveRecord: 0.0ms)

任何帮助表示赞赏!

4

1 回答 1

0

没有完全回答您使用omniauth-password 的具体问题,但是,您是否考虑过使用omniauth-identity?它是一种基于数据库的策略,使用用户名(或电子邮件)和密码凭据,并且有一个 Railscast。并且:我成功地使它与其他策略一起使用。

Omniauth 身份:https ://github.com/intridea/omniauth-identity

Railscast:http ://railscasts.com/episodes/304-omniauth-identity

于 2013-04-12T07:16:12.680 回答