heartcombo / devise

Flexible authentication solution for Rails with Warden.
http://blog.plataformatec.com.br/tag/devise/
MIT License
24.01k stars 5.55k forks source link

warden.authenticate!(auth_options) returns 401 #4000

Open raj-odc-zz opened 8 years ago

raj-odc-zz commented 8 years ago

I am trying to login using devise it was throw an error as

User Load (1.6ms) SELECT "users".* FROM "users" WHERE "users"."email" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["email", "test@example.com"], ["LIMIT", 1]] Completed 401 Unauthorized in 4301ms (ActiveRecord: 8.6ms) Processing by Devise::SessionsController#new as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"pyqdm0LtXx3ZYaYPbftRpXSxKlhmKJTzcq9VSaHvlc/0s+zntVPyfZXemRaqbfQBdJdiM3XKrTn6iOZNVA53DA==", "user"=>{"email"=>"test@example.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"}

While go through the code and I found that warden.authenticate!(auth_options) returns as Completed 401 Unauthorized

I like to know what I am wrong

Thanks for the help

T3tr0 commented 8 years ago

Did you manage to find out a solution ? I'm encountering the same issue.

ulissesalmeida commented 8 years ago

@raj-odc Thank you for your report.

Could you please provide more information? Like for example:

Will be even more helpful if you provide a sample application that reproduces the error.

Best

ulissesalmeida commented 8 years ago

@raj-odc I'm closing this issue. Feel free to reopen when you have more information in how to reproduce the problem. You can create Devise test case or provide a sample application that reproduces the error.

andychongyz commented 8 years ago

Im facing the problem too!!!! Here is my issue link: https://github.com/plataformatec/devise/issues/4079

suryapandian commented 7 years ago

facing the same issue as well:

its is getting authenticated for this params: {"utf8"=>"✓", "authenticity_token"=>"5BMAUoZLUEgPZBVOAcQ8lFD4+pumP9kEvvXyelbnjeO36AZJQt2oRlraicQ6quvh/dccS0ELUkxjACgFcWFYAg==", "user"=>{"email"=>"vijay@xyz.com", "password"=>"voonik", "phone"=>"9443429932"}, "action"=>"create", "controller"=>"sessions", "format"=>"json", "session"=>{"user"=>{"email"=>"vijay@xyz.com", "password"=>"voonik", "phone"=>"9443429932"}}}

but failing for this:

{"utf8"=>"✓", "authenticity_token"=>"/ly2phwfsD3HEVkHK39ajYQGv6R4uj2z3B+3eiZEU0qtp7C92IlIM5KvxY0QEY34KSlZdJ+OtvsB6m0FAcKGqw==", "user"=>{"phone"=>"9443429932", "password"=>"voonik", "email"=>"vijay@xyz.com"}, "action"=>"create", "controller"=>"sessions", "format"=>"json", "session"=>{"user"=>{"phone"=>"9443429932", "password"=>"voonik", "email"=>"vijay@xyz.com"}}}

Only the order of the data has changed, everything else is the same.

Don't know what is causing the trouble, stuck with this issue for long.

marcelamiach commented 7 years ago

@suryapandian Any updates on that?

ghost commented 7 years ago

i am also facing the same issue .

winterbang commented 7 years ago

why? is there any people knowing how to solute

rlugge commented 2 years ago

I'm encountering this as well -- random failures from somewhere inside warden/devise for no apparent reason. I can reproduce with a specific combination of test cases on my machine -- I have to run a registration request, then a separate sign in request -- but don't have a general, reproduce-able test-case.

Rails 5.2.6.2 (latest), devise 4.8.0

truonglocbinh commented 2 months ago

I have same issue too I am working with OTP

truonglocbinh commented 2 months ago

@rlugge Did you resolve this problem ?