The Wayback Machine - https://web.archive.org/web/20200914144910/https://github.com/nuxt-community/auth-module/pull/709
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

Making nonce settable even if response_type is not equal to 'id_token' #709

Open
wants to merge 1 commit into
base: dev
from

Conversation

@gagandeep
Copy link

gagandeep commented May 29, 2020

Keycloak required nonce for response_type=token but there was no way I was able to set nonce.

Keycloak required nonce but there was no way I was able to set nonce for response_type=token.
@gagandeep gagandeep changed the title Making nonce settable even response_type is not equal to 'id_token' Making nonce settable even for response_type not equal to 'id_token' May 29, 2020
@gagandeep gagandeep changed the title Making nonce settable even for response_type not equal to 'id_token' Making nonce settable even if response_type is not equal to 'id_token' May 29, 2020
@gagandeep
Copy link
Author

gagandeep commented May 31, 2020

@pi0 & @JoaoPedroAS51 Please review this.

@jkupcho
Copy link

jkupcho commented Jun 15, 2020

You can enforce a nonce being sent by setting the response_type to id_token.

See:
https://github.com/nuxt-community/auth-module/blob/v4.9.1/lib/schemes/oauth2.js#L106

@gagandeep
Copy link
Author

gagandeep commented Jun 16, 2020

@jkupcho I agree with you. But, If I need to set nonce without id_token like in my case. It was not possible since it is a programmatic flaw.

we are extracting nonce from params in https://github.com/nuxt-community/auth-module/blob/v4.9.1/lib/schemes/oauth2.js#L82

However, we are setting nonce only if response_type is id_token as you pointed out.

My expectation was setting nonce through params however because of above-explained logic nonce cannot be set through params unless response_type is id_token.

Let me know, if you agree with me or not.

@jkupcho
Copy link

jkupcho commented Jun 20, 2020

Yeah I think that makes sense. Are you seeing flows where the nonce is necessary outside of id_token?

@gagandeep
Copy link
Author

gagandeep commented Jun 20, 2020

Keycloak has nonce enabled for token also. Default value of nonce usage in Keycloak is true.

useNonce - Adds a cryptographic nonce to verify that the authentication response matches the request (default is true).
https://www.keycloak.org/docs/latest/securing_apps/#methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.