Reputation: 467
I'm very confused as to how the nonce parameter is actually used for OpenID Connect. I am trying to authenticate users via Microsoft Azure and Google, sign in with Azure and Google respectively.
Here is my current (implicit) flow.
I'm confused as to where the nonce fits in with all of this, is not needed since I am using a JavaScript based flow instead of HTTP? Is it being handled implicitly by the browser client libraries?
How can I ensure that an attacker can't sniff the ID token between the Google/Microsoft server and browser AND browser and back-end and just re-send that ID token to authenticate as the user?
Upvotes: 0
Views: 2089
Reputation: 1863
The nonce
is quite similar to state
and also serves to counter replay
attack. The main difference is nonce
is returned back in the id_token
whereas state
is returned back in the redirect URI. Usually the library should generate it for you and verify in the id_token.
Btw if you have access to the back-end, I would recommend using code flow instead (or at least the new PKCE flow) as the implicit flow would be deprecated soon.
Upvotes: 3