-
Notifications
You must be signed in to change notification settings - Fork 792
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
Island: Add token type into token payload #3183
Conversation
If a new refresh token is generated, even if the old token isn't expired yet, the new one should be invalidated. We shouldn't have two valid refresh tokens for a user.
We don't revoke old refresh tokens because they expire automatically
The key should be the same in requests and responses, it's best to have a constant for it
Co-authored-by: VakarisZ <36815064+VakarisZ@users.noreply.github.com>
Extracting token owner code and explicit validation better conveys the logic
This method checks for island api user registration, not registered agents. Also, authentication_facade.py shouldn't be coupled to mongodb syntax
Token type will make sure that access tokens can't get validated for refresh tokens and vice-versa
ca39605
to
16b1ab1
Compare
self._refresh_token_validator.validate_token(refresh_token, token_type=TokenType.REFRESH) | ||
user_uniquifier = self._refresh_token_validator.get_token_payload(refresh_token) |
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.
This becomes a bit dangerous, because the user needs to call validate first. We could include the validation into payload retrieval. In that case, we should merge the TokenValidator
and TokenGenerator
into the TokenSerializer
.
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.
See #3181 (comment)
315c23c
to
a2ce7d3
Compare
We went a different direction. |
We went a different direction. |
Token type will make sure that access tokens can't get validated for refresh tokens and vice-versa
What does this PR do?
Fixes part of #3137.
Add any further explanations here.
PR Checklist
Testing Checklist