omn​​iauth-password给出invalid_credentials错误

时间:2012-12-05 11:08:07

标签: ruby-on-rails authentication passwords omniauth credentials

我完全按照此处所示设置了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)

任何帮助表示赞赏!

1 个答案:

答案 0 :(得分:0)

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

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

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