IE11 - Nonce does not match
- Code Snippet: 05-Token-Renewal from Samples
- Auth0.js version: 8.8.0
- Browser: IE11 v. 11.0.9600.18015IS
- OS: Windows 7 Professional SP1
Description/Issue Followed the instruction in the README.md pointing the app to my API. The app works flawlessly using Chrome. IE11 however fails when the authService.handleAuthentication is called after being redirected back to the app after a successful login. From what I can determine it fails with "Nonce does not match".
Did you change the sample code? If so, can you isolate the issue with a simple example so we can reproduce?
The only thing I did was add some alerts to the handleAuthentication method:
public handleAuthentication(): void {
alert(window.location.href);
this.auth0.parseHash((err, authResult) => {
alert('Result: ' + JSON.stringify(authResult));
alert('Error: '+ JSON.stringify(err));
if (authResult && authResult.accessToken && authResult.idToken) {
window.location.hash = '';
this.setSession(authResult);
this.router.navigate(['/home']);
} else if (err) {
this.router.navigate(['/home']);
}
});
}
alert('Result: ' + JSON.stringify(authResult));
That displays Result: null
alert('Error: '+ JSON.stringify(err));
That displays Error: {"error":"invalid_token","errorDescription":"Nonce does not match."}
I also changed the silent.html to look like the one from Issue #429.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
parent.postMessage(window.location.hash, 'http://localhost:4200');
</script>
</head>
<body></body>
</html>
Everything else is unchanged except for the variables pointing it to my API.
The app starts and I see the Home and Login buttons. I click the login button. This redirects me to my Auth0 login for my API. I successfully log in. All the callbacks and silent html appear to be hit. The app restarts due to the redirect from Auth0, the handleAuthentication gets hit from app.component and I get the alerts.
I'm seeing the same issue with auth0.js v8.9.3 on Safari Private window. After authentication, I see {"error":"invalid_token","errorDescription":"Nonce does not match."}. I could reproduce it with current angularjs quickstart as-is https://auth0.com/docs/quickstart/spa/angularjs
it seems the failover to CookieStorage isn't working. I added console.log for getItem and setItem. In Safari private window, auth0.js falls back on using CookieStorage correctly and uses it to set the Nonce in the cookieStorage. However after authentication when auth0.js does getItem the nonce is null. See the screenshot below

store.js seems to have solved similar issue for reference https://github.com/marcuswestin/store.js/issues/168#issuecomment-283123205
Hi! I'm sorry about the copy/paste message, but I'm cleaning up some stale issues. 🗑 It's been a while since this issue was opened. Are you still having this issue with the latest version? If so, please reopen it with some repro steps so we can help!