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

Possible regression: case-sensitive validation of token_type #255

Closed
jojonium opened this issue May 10, 2024 · 0 comments · Fixed by #256
Closed

Possible regression: case-sensitive validation of token_type #255

jojonium opened this issue May 10, 2024 · 0 comments · Fixed by #256

Comments

@jojonium
Copy link
Contributor

In 1.0.0, the functions isValidIDPNewTokensResponse and isValidIDPRefreshTokenResponse check if the token_type in an IDP response exactly matches (case-sensitive) Bearer, whereas in version 0.5.3 this field was checked case-insensitively here. This appears to be breaking our auth flows on the new version because ADFS returns the value as bearer (lowercase "b").

time="2024/05/10 14:48:12" level=debug msg="handling callback request" x-request-id="c772af90-0000-49a8-8a22-2b0c63d719f2" scope="authz" type="oidc" session-id="PEmFYiEPCYQImdc7OBLFhzOYgi7EmrzF3vysCSa9fLjXcknnYl8aimyK2HedRVJq"
time="2024/05/10 14:48:12" level=debug msg="getting authorization state" x-request-id="c772af90-0000-49a8-8a22-2b0c63d719f2" scope="session" type="memory" session-id="PEmFYiEPCYQImdc7OBLFhzOYgi7EmrzF3vysCSa9fLjXcknnYl8aimyK2HedRVJq"
time="2024/05/10 14:48:12" level=info msg="performing request to retrieve new tokens" x-request-id="c772af90-0000-49a8-8a22-2b0c63d719f2" scope="authz" type="oidc" session-id="PEmFYiEPCYQImdc7OBLFhzOYgi7EmrzF3vysCSa9fLjXcknnYl8aimyK2HedRVJq"
time="2024/05/10 14:48:12" level=info msg="token type is not Bearer in token response" x-request-id="c772af90-0000-49a8-8a22-2b0c63d719f2" scope="authz" type="oidc" session-id="PEmFYiEPCYQImdc7OBLFhzOYgi7EmrzF3vysCSa9fLjXcknnYl8aimyK2HedRVJq" token-type="bearer"
time="2024/05/10 14:48:12" level=debug msg="process result" x-request-id="c772af90-0000-49a8-8a22-2b0c63d719f2" scope="authz" type="oidc" session-id="PEmFYiEPCYQImdc7OBLFhzOYgi7EmrzF3vysCSa9fLjXcknnYl8aimyK2HedRVJq" allow=false status="InvalidArgument"

From RFC-6749:

   token_type
         REQUIRED.  The type of the token issued as described in
         Section 7.1.  Value is case insensitive.

So it appears the old behavior of case-insensitive validation was correct.

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

Successfully merging a pull request may close this issue.

1 participant