AxaFrance / oidc-client

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

Issue with React-oidc: Endless "Redirecting" Message and Failure to Redirect to Homepage after Token Expiry #1330

Closed mohamed-isak closed 2 months ago

mohamed-isak commented 3 months ago

Issue and Steps to Reproduce

I am encountering an issue with the React-oidc library where, upon token expiration, it shows a continuous "Redirecting" message instead of redirecting the user to the homepage after auto-login. This behavior persists even after the token has expired and auto-login is successful.

Access the application. Wait for the token to expire. Observe the continuous "Redirecting" message instead of being redirected to the homepage after successful auto-login.

Code:

const userManagerConfig = { "authority": "http://localhost:8080", "automaticSilentRenew": false, "client_id": "", "client_secret": "", "redirect_uri": "http://localhost:3001/callback", "response_type": "id_token token", "scope": "openid email profile role", "silent_redirect_uri": "http://localhost:3001/silent_callback", "loadUserInfo": true, "post_logout_redirect_uri": "http://localhost:3001" }

<AuthenticationProvider configuration={userManagerConfig} loggerLevel={oidcLog.ERROR} isEnabled={true} authenticating={() => SpinnerComponent("Loading Login...")} callbackComponentOverride={() => SpinnerComponent("Redirecting...")} sessionLostComponent={() => SpinnerComponent("Session lost...")} customEvents={customEvents}

Versions

"dependencies": { "@axa-fr/react-oidc-context": "^3.1.7", }

Screenshots

Expected

After the token expires, React-oidc should automatically redirect the user to the homepage upon successful auto-login.

Actual

Additional Details

guillaume-chervet commented 3 months ago

Hi @mohamed-isak , it seems you are using a very old version and unmaintened of the library. The best solution to help you is to migrate to the latest 7.X.X version.

mohamed-isak commented 2 months ago

Resolved