Devise Resource not Authenticated and Authorization header missing
srikanthreddy919 opened this issue · 2 comments
srikanthreddy919 commented
Devise Resource not Authenticated and Authorization header missing
Expected behavior
Authentication should work
Authorization header should be present in the response header which is missing
Actual behavior
Authentication not working
Authorization header missing in the response headers
Steps to Reproduce the Problem
My repo:
https://github.com/srikanthreddy919/test-devise-jwt
Debugging information
Provide the following information. Please, format pasted output as code. Feel free to remove the secret key value.
- Version of
devise-jwt
in use - 0.9.0 - Version of
rails
in use - 6.1.6 - Version of
warden-jwt_auth
in use - (0.6.0) - Output of
Devise::JWT.config
#<Dry::Configurable::Config values={:secret=>nil, :expiration_time=>1296000, :dispatch_requests=>[["POST", /^\/sign_in$/], ["POST", /^\/users\/sign_in$/], ["POST", /^\/users$/]], :revocation_requests=>[["DELETE", /^\/sign_out$/], ["DELETE", /^\/users\/sign_out$/]], :aud_header=>"JWT_AUD", :request_formats=>{}}>
- Output of
Warden::JWTAuth.config
#<Dry::Configurable::Config values={:secret=>nil, :algorithm=>"HS256", :expiration_time=>1296000, :aud_header=>"JWT_AUD", :mappings=>{:user=>User (call 'User.connection' to establish a connection)}, :dispatch_requests=>[["POST", /^\/sign_in$/], ["POST", /^\/users\/sign_in$/], ["POST", /^\/users$/]], :revocation_requests=>[["DELETE", /^\/sign_out$/], ["DELETE", /^\/users\/sign_out$/]], :revocation_strategies=>{:user=>JwtDenylist (call 'JwtDenylist.connection' to establish a connection)}}>
- Output of
Devise.mappings
{:user=>#<Devise::Mapping:0x00007f96e4866a78 @scoped_path="users", @singular=:user, @class_name="User", @klass=#<Devise::Getter:0x00007f96e48651c8 @name="User">, @path="users", @path_prefix=nil, @sign_out_via=:delete, @format=nil, @router_name=nil, @failure_app=Devise::FailureApp, @controllers={:sessions=>"users/sessions", :registrations=>"users/registrations", :passwords=>"devise/passwords"}, @path_names={:registration=>"", :new=>"new", :edit=>"edit", :sign_in=>"sign_in", :sign_out=>"sign_out", :password=>"password", :sign_up=>"sign_up", :cancel=>"cancel"}, @modules=[:database_authenticatable, :rememberable, :recoverable, :registerable, :validatable, :trackable, :jwt_authenticatable], @routes=[:session, :password, :registration], @used_routes=[:session, :password, :registration], @used_helpers=[:session, :password, :registration]>}
Please help me to resolve this issue.
waiting-for-dev commented
Hey, it seems you're missing configuring the secret key.
srikanthreddy919 commented
@waiting-for-dev I am able to get the token now. closing this.