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

Support refresh responses with nonce #252

Open
patrickpilch opened this issue May 20, 2023 · 2 comments
Open

Support refresh responses with nonce #252

patrickpilch opened this issue May 20, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@patrickpilch
Copy link

Describe the bug?

Some authorization servers return an ID token with a nonce after a refresh occurs. Currently the library's default token verifier unconditionally checks the id token against null in a refresh operation. This results in not being able to refresh tokens with this new SDK on the aforementioned authorization servers.

What is expected to happen?

https://openid.bitbucket.io/connect/openid-connect-core-1_0.html#RefreshTokenResponse

it SHOULD NOT have a nonce Claim, even when the ID Token issued at the time of the original authentication contained nonce; however, if it is present, its value MUST be the same as in the ID Token issued at the time of the original authentication, and [...]

Going off the amended spec, the validator should allow for refresh response id tokens to contain a nonce.

What is the actual behavior?

IdTokenValidator.Error.NONCE_MISMATCH is thrown.

Reproduction Steps?

You can reproduce this with Keycloak 21.1.0 by setting up a public client and configuring the sample application to authenticate against it. The "Refresh Access Token" button will result in a failure.

Additional Information?

https://bitbucket.org/openid/connect/issues/1025/ambiguity-with-how-nonce-is-handled-on

SDK Version and Artifact(s) used.

Version 1.1.3

Build Information

No response

@patrickpilch patrickpilch added the bug Something isn't working label May 20, 2023
@rajdeepnanua-okta rajdeepnanua-okta added enhancement New feature or request and removed bug Something isn't working labels Jul 27, 2023
@rajdeepnanua-okta
Copy link
Contributor

Hi @patrickpilch, thanks for bringing this to our attention. I will bring this up with our PM and we will prioritize this feature internally.

@JayNewstrom
Copy link
Contributor

You can also change the default behavior by using https://github.com/okta/okta-mobile-kotlin/blob/master/auth-foundation/src/main/java/com/okta/authfoundation/AuthFoundationDefaults.kt#L59-L66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants