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

[doc] 4.5.3.2.1.3 OIDC Tokens #753

Closed
adianas opened this issue Apr 2, 2020 · 0 comments · Fixed by #784
Closed

[doc] 4.5.3.2.1.3 OIDC Tokens #753

adianas opened this issue Apr 2, 2020 · 0 comments · Fixed by #784
Assignees
Labels
AdminGuide Fix will change the Admin Guide Enhancement Fix is an enhancement On-Hold PR needs work and should not be merged even if reviews are complete v4 CaaSP v4
Milestone

Comments

@adianas
Copy link

adianas commented Apr 2, 2020

4.5.3.2.1.3 OIDC Tokens

https://documentation.suse.com/suse-caasp/4.1/single-html/caasp-admin/#_oidc_tokens

If possible, please include the errors that users get for this type of situation and slightly adjust the wording to make it more clearer.

errors:
"msg="failed to rotate keys: keys already rotated by another server instance"
"msg="failed to get refresh token: not found"

https://bugzilla.suse.com/show_bug.cgi?id=1165701

This can be reproduced when you log into two different machines as one user and got different id-token/refresh-token pairs and both worked until expired. Then the first machine that logged in received an update, but not the other one. It seems this is expected and here’s the explanation from our engineering:

  1. Besides id-token/refresh-token 1:1 mapping, Dex regards one session per user that means refreshing id-token and refresh-token together. If there is a second user trying to login to get a new id-token, Dex will invalidate the previous id and refresh token for the first user which means the first user is still able to use the old id-token until expiration. After that, the first user is not allowed to refresh the id-token by the invalid refresh token but the second user does. (ref: https://github.com/innobead/dex/blob/d928ac0677f214df047b23bd67f54de74acaa47c/server/handlers.go#L732-L751)

  2. If sharing the same id-token in many places, all of them can be used until the expiration. Then the first user refreshing the id-token & refresh token will be able to continue accessing the cluster but others will encounter an error Refresh token is invalid or has already been claimed by another client because the refresh token got updated by the first user. (ref: https://github.com/innobead/dex/blob/d928ac0677f214df047b23bd67f54de74acaa47c/server/handlers.go#L905-L926)

What you encountered is refresh token getting updated along with id-token, so there is no ways to keep the same
So, if any token changes (id or refresh), it will cause users encountering claimed by another client. Basically this is OIDC OAuth 2 spec (https://tools.ietf.org/html/rfc6749#page-10), so please suggest user to get id token per user to resolve this issue.

Thanks,

@r0ckarong r0ckarong self-assigned this Apr 2, 2020
@r0ckarong r0ckarong added AdminGuide Fix will change the Admin Guide Enhancement Fix is an enhancement Reported v4 CaaSP v4 labels Apr 2, 2020
@r0ckarong r0ckarong added this to the Sprint 27 milestone Apr 3, 2020
@r0ckarong r0ckarong modified the milestones: Sprint 27, Sprint 28 Apr 20, 2020
@r0ckarong r0ckarong linked a pull request Apr 29, 2020 that will close this issue
@r0ckarong r0ckarong added Needs Review On-Hold PR needs work and should not be merged even if reviews are complete labels Apr 30, 2020
@r0ckarong r0ckarong modified the milestones: Sprint 28, Sprint 29 May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AdminGuide Fix will change the Admin Guide Enhancement Fix is an enhancement On-Hold PR needs work and should not be merged even if reviews are complete v4 CaaSP v4
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants