简体   繁体   中英

omniauth-password giving invalid_credentials error

I set up omniauth-password exactly as shown here: https://github.com/namick/omniauth-password

I, however, get an invalid_credentials error every time I try to sign in. Now, there are no users in my database so it should be creating them right? I'm kind of confused where registration fits into this.

The problem is that my controller is not even being called. Here are the logs.

(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)

Any help appreciated!

not quite answering your specific problem with omniauth-password but, have you considered using omniauth-identity? It's a database-based strategy that used username (or email) and password credentials, and there is a Railscast of it. And: I succesfuully made it work with other strategies.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM