-
Notifications
You must be signed in to change notification settings - Fork 493
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
Nonce does not match [8.2.0] #365
Comments
+1 Same problem - no other info, just a |
@murtyjones by any chance are you in IE? and what version? |
Auth0 version 8.2.0; issue has been observed in Chrome 56+ but not tested in IE. I seem to have worked around it by passing the nonce explicitly to parseHash.
|
@murtyjones are you generating the nonce yourself? |
Nope, receiving it as part of the id_token in the callback after login. |
@murtyjones can you build up a small sample to see it. I fail to see the issue and still works from me so it should be a subtle detail we are missing. (you can use one of our quickstarts as template). In theory the nonce handling should be done by auth0.js so you should not be parsing and passing the nonce unless you are building it yourself. |
I'm also seeing this issue in the ember-simple-auth-auth0 addon |
@hzalaz Not sure I have much to add by building a new example, as the code previously posted is basically it with respect to the auth0 API's usage. |
I had this issue occur due to an '=' character being appended to my base64 encoded state data. Check to make sure your state (if you specify it) doesn't include an '=', the auth0 library will not decode %3D and subsequently fails to find the appropriate transaction to verify the nonce |
@DigitalFoundry-Brandon can you submit an issue describing it please? We'll fix it in the next version |
Thanks a lot @DigitalFoundry-Brandon |
FYI: in my case, the problem was that I was calling parseHash and not specifying options (as the samples e.g. https://github.com/auth0-samples/auth0-react-samples/blob/master/01-Login/src/Auth/Auth.js#L29 do. Once I changed: this.auth0.parseHash((err, authResult) => { to this.auth0.parseHash(window.location.hash, (err, authResult) => { the nonce complaint went away. |
Thanks @davidascher, that fixed my problem as well. Strange though as the sample Angular 2 app on Auth0 site did not include the window.location.hash. |
Thanks @davidascher, that fixed my issue too. |
That's very weird, indeed. auth0.js/src/web-auth/index.js Line 140 in 84f0dd5
This line will use |
@mmazzarolo I just tested with our test page, and everything works. Including calling Do you think you help us by creating a simple repro project so we can find this issue? |
Yup, I'll probably release soon the project repo (it's private while being a wip) |
I was also experiencing this bug and to my surprise the |
I'm still working on it, sorry. |
Ran into this and believe i may have found the cause (however didn't dig for the solution). Appears when passing in this.auth0.parseHash((err, authResult) => { leads to: if (parsedQs.id_token && options._idTokenVerification) {
// where
options._idTokenVerification = true this.auth0.parseHash(window.location.hash, (err, authResult) => { leads to: if (parsedQs.id_token && options._idTokenVerification) {
// where
options._idTokenVerification = undefined |
We're using hosted lock and we're experiencing the same issue, but only sometimes. As @tiny-dancer already mentioned: the "fix" with using We noticed that sometimes function Most of the times it's possible to reproduce the issue by using firefox in incognito mode. In general, it looks like localStorage behaves strangely from time to time. It might be that |
I am getting the same error, how can this still be an issue. We cannot use a product so important for login that works sometime and sometimes does not. Also why has this not been urgently resolved by the Auth0 team? |
@wpitallo do you have more info on what's going on? Can you share a code snippet on how you're using auth0.js so I can take a look? We did some state/nonce changes in previous versions, so make sure you're using the latest version. |
I ended up changing to the following in my code: webAuth.parseHash(window.location.hash, (err, authResult) => and it seem to be ok, will do more testing tho. It must have been quite recently because I used quite a recent see here: https://auth0.com/docs/quickstart/spa/vanillajs/01-login or is this correct? Might just be a case of documentation that's out of date? |
Thx for the prompt response btw 🥇 |
I followed the tutorial in the link above and I am using auth0.min.js v8.10.1 |
Both should work, really. Are you saying that |
We had some changes in v8.11 and also had a security patch in v8.12, so you probably want to upgrade to the latest version so you can have the latest fixes! |
Awesome will do that thanks! |
@wpitallo by the way, the latest major is v9, so the latest version is 9.2.2. |
Awesome thanks!!! |
I'm using parseHash to parse the access_token returned after logging a user in and occasionally receiving an error about the nonce not matching.
I'm passing
window.location.hash
to the parseInfo function. Is there something I'm missing based on the above configuration that might sometimes return a nonce match error?The text was updated successfully, but these errors were encountered: