angular-auth-oidc-client icon indicating copy to clipboard operation
angular-auth-oidc-client copied to clipboard

Local Nonce Empty

Open JoellyR opened this issue 7 years ago • 5 comments

Hi there,

I have went through the past issues for nonce and checked to make sure I am not having the same issues as the others... I seem to be sending the nonce and recieving the correct nonce from the server all the way up to the token call. Though I get the following message, which has local nonce as nothing:

Validate_id_token_nonce failed, dataIdToken.nonce: N0.52989967962089281570646580662 local_nonce:

I am using version 10.0.2, I was wondering if anything like this is known to be fixed in the newer versions. (I looked through the change log and don't seem to see anything specifically stating this)

Attached is some screen shots:

The error:

image

The Token Response:

image

JoellyR avatar Oct 09 '19 19:10 JoellyR

I just updated from 9.0.5 to 10.0.10 and got the same error.

After some debugging, it seems the silent renew is triggered even if we are not logged in already, which result in a reset of the nonce.

I can't check more for now, but it seems to be a good hint

Itori avatar Oct 10 '19 15:10 Itori

more for now, but it seems to be a goo Thanks for sharing your experience with the issue, if I find out anything more i'll let you know!

JoellyR avatar Oct 10 '19 17:10 JoellyR

I think I have experienced a very similar issue.

Test that I did: I opened up 4 tabs. I left them 10 minutes, it logged me out. 

What happened: tab 1: silent-renew request at "15:31:04 GMT", "15:36:24", "15:41:49 GMT", tab 2: None tab 3: silent-renew request at "15:41:49 GMT" tab 4: None Silent-renew requests of tab 1 and tab 3 were begun in 5 microseconds difference.

Looking at the log, tab 1 and tab 3 are receiving different id_tokens but the same access_tokens. It looks like the nonce sent from tab 1 and tab 3 are different. If you look at the log, the two simultaneously ran requests got the same state, but different session_states.

Tab 1 failed during id_token validation. Tab 3 failed during Vadliation from state.

It looks like when validating the sessin_state and id_tokens, the 2 tabs had race condition conflicts and used wrong data from one another.

Tab 1's logs: image

Tab 3's logs: image

From these information above, I suspect that "storage_silent_renew_running_price_select_web" Key that is stored in local_storage is causing some race condition issue. One tab starts the silent renew and writes "storage_silent_renew_running_price_select_web" to true, but another tab reads it before "storage_silent_renew_running_price_select_web" is getting updated, and then runs the second silent-renew request.

@JoellyR Please confirm whether you are using localStorage or sessionStorage.

AraiYuno avatar Oct 17 '19 16:10 AraiYuno

@AraiYuno I am using session storage

JoellyR avatar Oct 30 '19 17:10 JoellyR

@AraiYuno in my case i found that it may be the isauthorizedrace_timeout_in_seconds limit being reached which by default is only 5 seconds.. If the authorization server takes to long to respond then it seems like there it is triggering a reset of authorization variables ... one being the local nonce.

@damienbod Not sure if you want to close this or mark it as resolved.

JoellyR avatar Nov 04 '19 19:11 JoellyR