auth0.js: Nonce does not match
I am getting an invalid_token: Nonce does not match.
error from auth0.js when using the official example from here
The script:
webAuth.renewAuth({
scope: 'openid',
redirectUri: 'http://localhost:3000/silent-callback.html'
}
The silent callback:
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.auth0.com/js/auth0/8.6.1/auth0.min.js"></script>
<script type="text/javascript">
var webAuth = new auth0.WebAuth({
domain: '****',
clientID: '****'
});
var result = webAuth.parseHash(window.location.hash, function(err, data) {
parent.postMessage(err || data, "http://localhost:3000");
});
</script>
</head>
<body></body>
</html>
It works if I use the usePostMessage
option, which I cannot use because of #428
I am using Auth0.js 8.6.1 on latest Chrome.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (8 by maintainers)
As per dorilla’s comment above, we need to pass a random string to ‘solve’ the same problem of nonce errors. Not super happy with this workaround to be honest, mainly because I can’t explain it. Can anyone shed some light on why we need to do this?
auth.js
routes.js
SilentCallback.js