You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
@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 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
Reacted by Trevor de Koekkoek, Brian Bleakley, Robert DeLuca, JunkMyFunk, Jeremy Dorfschmidt, Matteo Mazzarolo, Briet Sparks, Per Ström, Fernando Hurtado, Craig Hunter and 5 more
I'm still working on it, sorry.
I'll drop an hint though: may it is be related to the fact that I'm calling parseHash from a different application (with even a different domain) than the one that called authorize?
Ran into this and believe i may have found the cause (however didn't dig for the solution). Appears when passing in window.location.hash it skips the token verification, thus removing the error.
We're using hosted lock and we're experiencing the same issue, but only sometimes.
As @tiny-dancer already mentioned: the "fix" with using this.auth0.parseHash(window.location.hash, (err, authResult) => { works because it simply disables the token verification. Function parseHash accepts either callback or options object and a callback. The proper way to pass the hash would be this.auth0.parseHash({hash: window.location.hash}, (err, authResult) => { and it behaves identically to just this.auth0.parseHash((err, authResult) => {.
We noticed that sometimes function authorize will not persist generated nonce. And it leads later (after redirecting to the callback page) to the Nonce does not match error. We failed to understand why exactly it's happening.
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 authorize tries to use localStorage before it's available.
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:
Both should work, really. Are you saying that parseHash((err, authResult) => {}) throws the nonce doesn't match error but parseHash(window.location.hash, (err, authResult) => {}) doesn't? If that's the case, it's definitely a bug!
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!
Activity
iongion commentedon Mar 1, 2017
+1 Same problem - no other info, just a
Nonce does not match...hzalaz commentedon Mar 1, 2017
@murtyjones by any chance are you in IE? and what version?
murtyjones commentedon Mar 1, 2017
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.
hzalaz commentedon Mar 1, 2017
@murtyjones are you generating the nonce yourself?
murtyjones commentedon Mar 1, 2017
Nope, receiving it as part of the id_token in the callback after login.
hzalaz commentedon Mar 1, 2017
@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.
seawatts commentedon Mar 3, 2017
I'm also seeing this issue in the ember-simple-auth-auth0 addon
murtyjones commentedon Mar 4, 2017
@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.
BLevinger commentedon Mar 6, 2017
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
hzalaz commentedon Mar 6, 2017
@DigitalFoundry-Brandon can you submit an issue describing it please? We'll fix it in the next version
BLevinger commentedon Mar 6, 2017
@hzalaz Issue logged as #377
hzalaz commentedon Mar 6, 2017
Thanks a lot @DigitalFoundry-Brandon
davidascher commentedon May 25, 2017
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:
to
the nonce complaint went away.
5 remaining items
mmazzarolo commentedon Aug 21, 2017
Yup, I'll probably release soon the project repo (it's private while being a wip)
fhur commentedon Aug 31, 2017
I was also experiencing this bug and to my surprise the
window.location.hashtrick did fix it.mmazzarolo commentedon Aug 31, 2017
I'm still working on it, sorry.
I'll drop an hint though: may it is be related to the fact that I'm calling
parseHashfrom a different application (with even a different domain) than the one that calledauthorize?tiny-dancer commentedon Oct 15, 2017
Ran into this and believe i may have found the cause (however didn't dig for the solution). Appears when passing in
window.location.hashit skips the token verification, thus removing the error.leads to:
leads to:
eicca commentedon Nov 7, 2017
We're using hosted lock and we're experiencing the same issue, but only sometimes.
As @tiny-dancer already mentioned: the "fix" with using
this.auth0.parseHash(window.location.hash, (err, authResult) => {works because it simply disables the token verification. FunctionparseHashaccepts either callback or options object and a callback. The proper way to pass the hash would bethis.auth0.parseHash({hash: window.location.hash}, (err, authResult) => {and it behaves identically to justthis.auth0.parseHash((err, authResult) => {.We noticed that sometimes function
authorizewill not persist generated nonce. And it leads later (after redirecting to the callback page) to theNonce does not matcherror. We failed to understand why exactly it's happening.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
authorizetries to use localStorage before it's available.wpitallo commentedon Feb 8, 2018
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?
luisrudge commentedon Feb 8, 2018
@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.
wpitallo commentedon Feb 8, 2018
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
this is still using webAuth.parseHash(function(err, authResult) {
or is this correct?
Might just be a case of documentation that's out of date?
wpitallo commentedon Feb 8, 2018
Thx for the prompt response btw 🥇
wpitallo commentedon Feb 8, 2018
I followed the tutorial in the link above and I am using auth0.min.js v8.10.1
luisrudge commentedon Feb 9, 2018
Both should work, really. Are you saying that
parseHash((err, authResult) => {})throws thenonce doesn't matcherror butparseHash(window.location.hash, (err, authResult) => {})doesn't? If that's the case, it's definitely a bug!luisrudge commentedon Feb 9, 2018
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!
wpitallo commentedon Feb 9, 2018
Awesome will do that thanks!
luisrudge commentedon Feb 9, 2018
@wpitallo by the way, the latest major is v9, so the latest version is 9.2.2.
wpitallo commentedon Feb 9, 2018
Awesome thanks!!!