{"action":"created","issue":{"url":"https://api.github.com/repos/waiting-for-dev/devise-jwt/issues/47","repository_url":"https://api.github.com/repos/waiting-for-dev/devise-jwt","labels_url":"https://api.github.com/repos/waiting-for-dev/devise-jwt/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/waiting-for-dev/devise-jwt/issues/47/comments","events_url":"https://api.github.com/repos/waiting-for-dev/devise-jwt/issues/47/events","html_url":"https://github.com/waiting-for-dev/devise-jwt/issues/47","id":271952901,"number":47,"title":" JWT::VerificationError - Signature verification raised","user":{"login":"elisoncampos","id":5031917,"avatar_url":"https://avatars0.githubusercontent.com/u/5031917?v=4","gravatar_id":"","url":"https://api.github.com/users/elisoncampos","html_url":"https://github.com/elisoncampos","followers_url":"https://api.github.com/users/elisoncampos/followers","following_url":"https://api.github.com/users/elisoncampos/following{/other_user}","gists_url":"https://api.github.com/users/elisoncampos/gists{/gist_id}","starred_url":"https://api.github.com/users/elisoncampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elisoncampos/subscriptions","organizations_url":"https://api.github.com/users/elisoncampos/orgs","repos_url":"https://api.github.com/users/elisoncampos/repos","events_url":"https://api.github.com/users/elisoncampos/events{/privacy}","received_events_url":"https://api.github.com/users/elisoncampos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"waiting-for-dev","id":52650,"avatar_url":"https://avatars1.githubusercontent.com/u/52650?v=4","gravatar_id":"","url":"https://api.github.com/users/waiting-for-dev","html_url":"https://github.com/waiting-for-dev","followers_url":"https://api.github.com/users/waiting-for-dev/followers","following_url":"https://api.github.com/users/waiting-for-dev/following{/other_user}","gists_url":"https://api.github.com/users/waiting-for-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/waiting-for-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waiting-for-dev/subscriptions","organizations_url":"https://api.github.com/users/waiting-for-dev/orgs","repos_url":"https://api.github.com/users/waiting-for-dev/repos","events_url":"https://api.github.com/users/waiting-for-dev/events{/privacy}","received_events_url":"https://api.github.com/users/waiting-for-dev/received_events","type":"User","site_admin":false},"assignees":[{"login":"waiting-for-dev","id":52650,"avatar_url":"https://avatars1.githubusercontent.com/u/52650?v=4","gravatar_id":"","url":"https://api.github.com/users/waiting-for-dev","html_url":"https://github.com/waiting-for-dev","followers_url":"https://api.github.com/users/waiting-for-dev/followers","following_url":"https://api.github.com/users/waiting-for-dev/following{/other_user}","gists_url":"https://api.github.com/users/waiting-for-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/waiting-for-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waiting-for-dev/subscriptions","organizations_url":"https://api.github.com/users/waiting-for-dev/orgs","repos_url":"https://api.github.com/users/waiting-for-dev/repos","events_url":"https://api.github.com/users/waiting-for-dev/events{/privacy}","received_events_url":"https://api.github.com/users/waiting-for-dev/received_events","type":"User","site_admin":false}],"milestone":null,"comments":17,"created_at":"2017-11-07T19:25:06Z","updated_at":"2017-11-08T13:38:59Z","closed_at":null,"author_association":"NONE","body":"Hi! I'm setting up an API that used devise and devise-jwt for authentication and I followed up all the steps in order to make it work. However, whenever I tried to sign in within my BackEnd i' receive a 401 response.\r\n\r\nSo I dug up on the code and found that within `warden.authenticate!` was raising an error and being rescued by:\r\n```ruby\r\n      def authenticate!\r\n        user = UserDecoder.new.call(token, scope)\r\n        success!(user)\r\n      rescue JWT::DecodeError\r\n        fail!\r\n      end\r\n```\r\nFollowing that lead, I found that the error being raised was a **JWT::VerificationError - Signature verification raised**, however I created my secret key using `rails secret`as proposed in the configuration guide. Here's the line in my `config/initializers/devise.rb`\r\n\r\n```ruby\r\n  config.jwt do |jwt|\r\n    jwt.expiration_time = 3.hours\r\n    jwt.secret = ENV.fetch('DEVISE_JWT_SECRET_KEY') { 'db70e50ec08feabaa1f05c65dadfc8057fb774052ff8fe7bc90b6d4001bfb681bbd6c26fbf06b77f39078270093948a5fd9ea09fac495fc9f7aab43241836dcf' }\r\n  end\r\n```\r\nI even tried running it with the ENV variable forced and just plain value in the config just to test if it was something wrong with fetch method from ENV but it still doesn't work, any help?"},"comment":{"url":"https://api.github.com/repos/waiting-for-dev/devise-jwt/issues/comments/342819828","html_url":"https://github.com/waiting-for-dev/devise-jwt/issues/47#issuecomment-342819828","issue_url":"https://api.github.com/repos/waiting-for-dev/devise-jwt/issues/47","id":342819828,"user":{"login":"waiting-for-dev","id":52650,"avatar_url":"https://avatars1.githubusercontent.com/u/52650?v=4","gravatar_id":"","url":"https://api.github.com/users/waiting-for-dev","html_url":"https://github.com/waiting-for-dev","followers_url":"https://api.github.com/users/waiting-for-dev/followers","following_url":"https://api.github.com/users/waiting-for-dev/following{/other_user}","gists_url":"https://api.github.com/users/waiting-for-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/waiting-for-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waiting-for-dev/subscriptions","organizations_url":"https://api.github.com/users/waiting-for-dev/orgs","repos_url":"https://api.github.com/users/waiting-for-dev/repos","events_url":"https://api.github.com/users/waiting-for-dev/events{/privacy}","received_events_url":"https://api.github.com/users/waiting-for-dev/received_events","type":"User","site_admin":false},"created_at":"2017-11-08T13:38:59Z","updated_at":"2017-11-08T13:38:59Z","author_association":"OWNER","body":"If I remember well, you need to add `respond_to :json` to your controller, and configure devise to use `json` as default route format (in the router). You don't need a custom `SessionsController`."}}
{"actor":{"display_login":"waiting-for-dev"}}