AxaFrance / oidc-client

Light, Secure, Pure Javascript OIDC (Open ID Connect) Client. We provide also a REACT wrapper (compatible NextJS, etc.).
MIT License
582 stars 158 forks source link

Upgrading react-oidc-context 3.1.6 to 3.1.7 -- stuck in endless loop at the callbackComponent page calling the openid-config endpoint #642

Closed jafin closed 3 years ago

jafin commented 3 years ago

Issue and Steps to Reproduce

Seeking advice on where to look for the below issue, need to isolate the problem down a bit more.

Updating package @axa-fr/react-oidc-context 3.1.6 to 3.1.7

After a user logins in. They hit the callbackComponentOverride , the component displays successfully.

But in the browser console it will enter an endless loop with network calls to the discovery openid-configuration endpoint, locking up the browser.

In the AuthenticationProvider component, loggerLevel is DEBUG

All I see in the browser console is a set of oidc debug messages in a continual loop:

UserManager._loadUser: user storageString loaded
oidc-client.min.js:1 User.fromStorageString
oidc-client.min.js:1 UserManager._loadUser: user storageString loaded
oidc-client.min.js:1 User.fromStorageString
oidc-client.min.js:1 UserManager._loadUser: user storageString loaded
oidc-client.min.js:1 User.fromStorageString
oidc-client.min.js:1 UserManager.getUser: user loaded
oidc-client.min.js:1 UserManagerEvents.load
oidc-client.min.js:1 AccessTokenEvents.load: access token present, remaining duration: 3586
oidc-client.min.js:1 AccessTokenEvents.load: registering expiring timer in: 3526
oidc-client.min.js:1 Timer.init timer Access token expiring skipping initialization since already initialized for expiration: 1624840098
oidc-client.min.js:1 AccessTokenEvents.load: registering expired timer in: 3587
oidc-client.min.js:1 Timer.init timer Access token expired skipping initialization since already initialized for expiration: 1624840159
oidc-client.min.js:1 UserManager.getUser: user loaded
oidc-client.min.js:1 UserManagerEvents.load
oidc-client.min.js:1 AccessTokenEvents.load: access token present, remaining duration: 3586
oidc-client.min.js:1 AccessTokenEvents.load: registering expiring timer in: 3526
oidc-client.min.js:1 Timer.init timer Access token expiring for duration: 3526
oidc-client.min.js:1 AccessTokenEvents.load: registering expired timer in: 3587
oidc-client.min.js:1 Timer.init timer Access token expired for duration: 3587
oidc-client.min.js:1 UserManager.getUser: user loaded

Any advice on where to investigate appreciated.

guillaume-chervet commented 3 years ago

Thank you for the report. It is a big bug. You may look at thé commit in the master history?

jafin commented 3 years ago

Thanks @guillaume-chervet , yes I intend to dig deeper by looking at the commit log and isolate my code for a repro. Posted early just in case someone may have had a similar issue and found an obvious fix.

EDIT: I cannot determine the cause of the error, nor can I establish an isolated test case. So I'll close this issue, should I have success in a repro I'll come back with more info.

jafin commented 3 years ago

related, others with similar issues experienced for 3.x line of code (not just 3.1.7) #644