-
Notifications
You must be signed in to change notification settings - Fork 1
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
RAS Authentication Updates #291
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes generally look good but may merit some unit testing/fixes in existing tests, happy to take that on if needed. We also need to enable signature verification.
dcicutils/redis_tools.py
Outdated
return jwt.decode(self.jwt, secret, audience=audience, leeway=leeway, | ||
options={'verify_signature': True}, algorithms=['HS256']) | ||
options={'verify_signature': False}, algorithms=algorithms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this still not work when verify_signature
= True?
eb4608e
to
564b1fc
Compare
Pull Request Test Coverage Report for Build 6908964577
💛 - Coveralls |
This PR extends the
value
that is stored as Redis(key, value)
pair:Old format:
jwtToken
New format:
jwtToken:email
(since jwtToken is base64 encoded, :(colon as the separator makes sense.ToDo
From Researcher Auth Service (RAS) Project Partner Developer Guide:
To comply with GA4GH, only the following signing algorithm is supported: RS256.
While the data portals' Auth0 implementation works with HS256, RAS only uses RS256. Current JWT encoding/decoding functions throw the exception below since RS256 requires public/private keys to sign tokens. We bypassed the decoding's verify_signature by setting False for now, which should be True in production.
ValueError: ('Could not deserialize key data. The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type (e.g. EC curves with explicit parameters).', [_OpenSSLErrorWithText(code=75497580, lib=9, reason=108, reason_text=b'error:0480006C:PEM routines::no start line')])
Related PRs: