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

Optional ID token should not be required on token refresh #102

Open
anderius opened this issue Sep 23, 2024 · 1 comment
Open

Optional ID token should not be required on token refresh #102

anderius opened this issue Sep 23, 2024 · 1 comment

Comments

@anderius
Copy link

anderius commented Sep 23, 2024

Our setup fails to refresh tokens, simply because our IdP does not return id_token in the refresh token response.

As can be seen here, that is optional: https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokenResponse

Upon successful validation of the Refresh Token, the response body is the Token Response of Section 3.1.3.3 except that it might not contain an id_token.

The code here, however, requires id_token:

if (!tokenset.id_token) {
r.error("OIDC refresh response did not include id_token");
if (tokenset.error) {
r.error("OIDC " + tokenset.error + " " + tokenset.error_description);
}
r.variables.refresh_token = "-";
r.return(302, r.variables.request_uri);
return;

It would be nice if id_token was not required.

@anderius
Copy link
Author

anderius commented Oct 16, 2024

Another very related issue with the code is that it uses the id token in the variable session_jwt, and that is used in validating each request:

auth_jwt "" token=$session_jwt;

This does not work when the id-token is not refreshed.

@anderius anderius changed the title Optional ID token is required upon token refresh Optional ID token should not be required on token refresh Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant