Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT decode callback token exception #218

Closed
handleror opened this issue Dec 18, 2015 · 4 comments
Closed

JWT decode callback token exception #218

handleror opened this issue Dec 18, 2015 · 4 comments

Comments

@handleror
Copy link

got this issue after omniauth callback results:
JWT::InvalidIatError (Invalid iat): jwt (1.5.0) lib/jwt.rb:170:indecode'
omniauth-google-oauth2 (0.2.8) lib/omniauth/strategies/google_oauth2.rb:61:in block in <class:GoogleOauth2>'

@Ashviniv
Copy link

I got the same error.I skipped JWT decoding by adding scope skip_jwt: true in the omniauth configuration file i.e omniauth.rb.

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :google_oauth2, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, {scope: 'email', skip_jwt: true}
end

@handleror
Copy link
Author

Thank @Ashviniv, I just found in these issues
#195
#196
Guest it should be closed

@Shwetakale
Copy link

@Ashviniv @handleror Do you know root cause of this issue? I am facing same issue and behavior is total random. Sometimes I am successfully able to login and sometimes get this error. I observed such errors in my production log as well and those are very random or do anyone of you know reproduction steps?

@Ashviniv
Copy link

Ashviniv commented Sep 9, 2016

@Shwetakale As per my knowledge and the closed issue #195 omniauth-google-oauth2 uses JWT gem, which contains the ruby implementation of oauth algorithm. which internally uses JWT.decodeto ensure that an attacker cannot bypass the algorithm verification step.
It uses iat timestamp and if there is timestamp mismatch this error comes. With the option skip_jwt: true. we avoid calling JWT.decode.

I hope the Issue #195 can help you to reproduce the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants