I am getting an error where the computed nonce does not match the input. Why is this?
Often this will be a frontend issue, rather on the backend from the OAuth provider.
Frontend libraries can handle the passing of nonces differently. For example:
- Some OAuth libs cache the nonce and need to be flushed.
- Some OAuth libs hash the nonce and need to be explicitly configured to send a raw nonce.
- Some OAuth libs set up their own nonce and override yours e.g set
useNonce: false
in order to accept your custom nonce.
For example, using react-native-app-auth
you can configure it as follows:
useNonce: false,
additionalParameters: {
nonce: myNonce,
}