question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite loop of redirects after logging in

See original GitHub issue

So I am trying to make a nextjs project using keycloack as authentication server and I am using this project to make it work, the problem is after I signin it will redirect me in an infinite loop.

steps to reproduce:

Run a Keycloak server and create a client app (The name you enter is the clientID) localhost_8080_admin_master_console_

Next clone the nextjs demo (From react-oidc) and change settings in the layout component to the links you can find at http://localhost:8080/realms/REALMNAME/.well-known/openid-configuration image

Now start the nextjs with “yarn dev” and go to localhost:3001 then login and it wil keep redirecting you

Versions

@axa-fr/react-oidc”: “^5.11.1”,

Screenshots

Being sent in console every redirect image

(laggy video) https://user-images.githubusercontent.com/26123873/178000395-1a0343a2-6741-403a-97ce-d7f496181f03.webm

Expected

Show me te page I have to login for.

Actual

Infinite redirecting

Additional Details

  • Installed packages:
  "dependencies": {
    "@axa-fr/react-oidc": "^5.11.1",
    "next": "latest",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  }

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:27 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
Copystrikecommented, Jul 10, 2022

THank you very much @Copystrike for your big help 👍

Ayy, No problem! Thankyou a lot for fixing this, I can finally do some authentication with Keycloak!

Well this issue can be closed since the problem is fixed 😁, but will open a new one since I noticed another problem regarding another issue 😅.

1reaction
guillaume-chervetcommented, Jul 9, 2022

Thank you very much for your vidéo, i think there is another part of the bug here https://github.com/AxaGuilDEv/react-oidc/blob/master/packages/react/src/oidc/core/routes/OidcRoutes.tsx I have to sleep, i will try to fix it tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App infinitely redirecting after login - Auth0 Community
Common reasons are 1) Auth0 developer keys are being used instead of your own credentials for a social connection or 2) the browser...
Read more >
How to Solve This Webpage has a Redirect Loop Problem
Solve Problem by Deleting Cookies ... Open the browser that is showing this error. Here we will take Google Chrome as example. Click...
Read more >
Node.js Express infinite redirect loop after successful login
After the user logs in or registers, it redirects back to the private root, but keycloak protect fails again and redirects you back...
Read more >
How to Fix The ERR_TOO_MANY_REDIRECTS Error - Kinsta
The ERR_TOO_MANY_REDIRECTS is, as the error suggests, caused by too many redirects, resulting in a redirect loop.
Read more >
Login Redirection Going On An Infinite Loop Due To Using A ...
When accessing the home.jspx page of a Custom WebCenter Portal application, it redirects to login.jspx and then redirects to login.html and this ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found