-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support for multiple refresh tokens per user #2284
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Vinod Patil <[email protected]>
15cd732
to
5970b22
Compare
Would be great to have this. Kind of a nuissance as it is now. |
@nabokihms will you be able to have a look on this or assign another person ? |
@Elentary Before implementation, we'd like to hear more about use cases, like when the limitation of a single token per user is an obstacle. |
@nabokihms I’d happy to. We use Dex for k8s auth via OIDC with Google as IdP (k8s talks with Dex, and Dex use Google to login users). The solution is to allow multiple refresh tokens (“sessions”) per user, so one user can use different valid tokens on different devices to refresh id tokens. |
@nabokihms do you need any other actions or info ? |
We have similar issues. Developers obviously need tokens on their laptops, but often also need to run tests, automations, etc, from other machines. This is a major nuisance as it is is now. Also: Developers often does not have the knowledge about this, so their tokens may stop working on their laptops, due to this, and then they file support issues with out IT department, etc. |
@sagikazarmark @nabokihms could you take a look, please ? |
@nabokihms @sagikazarmark @justaugustus gentle remind on this, we are pinging for 5 months without any response from the team |
Closes #981
This PR introduces
multipleTokens
option underexpiry.refreshTokens
in config to configure multi refresh tokens per user.Details
multipleTokens.allow
option defaults to false and in that case this PR does not change any behavior.multipleTokens.maximumCount
option specifies maximum refresh tokens per user which defaults to50
-multipleTokens.replacementPolicy
specifies then old token deletion/replacement policy if number of tokens issued crossed specifiedmultipleTokens.maximumCount
which defaults to LRU.multipleTokens.allow
is true, Dex skips to delete a refresh token in issuing an id token.ListRefresh
andRevokeRefresh
gRPC API useStorage.ListRefreshTokens
inmultipleTokens.allow
mode. This can be heavy but num of refresh tokens not is expected very high (same as num of id tokens).storage.OfflineSessions.Refresh
contains the latest-issued refresh token.