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 Profile Grant: return id_token if openid scope is set #587

Open
1 task
livio-a opened this issue Apr 10, 2024 · 6 comments · May be fixed by zitadel/zitadel#7822
Open
1 task

JWT Profile Grant: return id_token if openid scope is set #587

livio-a opened this issue Apr 10, 2024 · 6 comments · May be fixed by zitadel/zitadel#7822

Comments

@livio-a
Copy link
Member

livio-a commented Apr 10, 2024

Although JWT Profile Authorization is an Oauth2-only extension (there is no mention in the OIDC standard) it would be useful if we return an ID Token is the requested scope is set to openid. This is to have a compatible result with the rest of the toolkit, regardless of the method of authentication flow that is chosen.

Acceptance criteria

  • When scope openid is set, an ID Token to be returned to the client on JWT Profile Grant.
@akaegi
Copy link

akaegi commented Apr 11, 2024

Furthermore, it would be desirable to have a refresh_token returned as well if scope offline_access is given.

Reason: This would allow to use the same token refresh mechanism (as is used for "auth code" grant type) in a client application.

@muhlemmer
Copy link
Collaborator

@akaegi we did discuss this. But as the JWT profile grant already works without user interaction, there is no real offline_access. The app might as well just send a freshly signed JWT, instead of needing a refresh token.

@akaegi
Copy link

akaegi commented Apr 11, 2024

I understand your reasoning @muhlemmer. However it produces more code on client side because token renewal has to be implemented manually. Otherwise this can be handled by most libraries that automatically renew access tokens based based on the "refresh token grant".

@muhlemmer
Copy link
Collaborator

I also understand your reasoning. However, we enforce the grant type on the token endpoint by OIDC client config. For refresh_token the OIDC config must contain that grant. In our current model, only OIDC apps have OIDC config. But JWT profile can be used by so much more, like APIs and service users. If those apps would start sending refresh tokens, they would simply get an error back that the grant is not allowed. So supporting refresh tokens here, is not as simple at the moment. This limitation is also present for other features and I'm currently rethinking the data model to unify the different App types we have, but I don't have anything formal yet.

Currently this issue discusses returning an ID token. We estimated this to be an easy fix that takes us less than a day, hence we categorized it as "Small issue". Adding refresh token functionality to this issue won't fit that definition anymore by the above reasoning. Hence, we will probably not do it now. I suggest you open a separate issue / feature request which can be estimated independently.

@livio-a
Copy link
Member Author

livio-a commented May 7, 2024

zitadel/zitadel#7822 would fix this

@muhlemmer
Copy link
Collaborator

It would fix it only for zitadel through the custom implementation of the ClientCredentials server method. Is that sufficient for the requested usecase?

@muhlemmer muhlemmer linked a pull request May 7, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🐛 Bugs/Small Issues
Development

Successfully merging a pull request may close this issue.

3 participants