Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old Version of Keycloak-JS potentially causes infinite reloading #99

Closed
BloodWorkXGaming opened this issue Aug 4, 2021 · 7 comments
Closed

Comments

@BloodWorkXGaming
Copy link

I am facing the problem of infinit reloading about every 5 seconds.

As I found in this post, it could be caused by a difference in the version of keycloak vs keycloak-js:
https://stackoverflow.com/questions/55606931/keycloak-js-library-iframe-redirect-when-alreadylogged-in

This library seems to be using version 9 while the version 15 is already out.

Is it possible to update it? Or is the refresh loop caused by something else?

@rgrosjean
Copy link

Is it not possible to force the installation of the latest version of keycloak-js? Could be a try.
Could also be related to this #1

@BloodWorkXGaming
Copy link
Author

So after further testing:

  • Updating to keycloak-js 15 didn't help (Used this package for forcing the version: https://www.npmjs.com/package/npm-force-resolutions)
  • Setting VueRouter to history mode didn't fix the reloading bug
  • Commenting out Vue.use(VueRouter) and the other router parts didn't fix the problem either

Would be glad if anyone has any ideas :)

@BloodWorkXGaming
Copy link
Author

Okay, I found the cause for the issue:

As I was hosting both services on localhost, I always got a CORS error.
This caused an infinit reload loop in Firefox and just a white screen in chromium based browser.
After moving keycloak behind a reverseproxy on the /auth url it now works (only tested it with v15 of keycloak-js)

Would love to see better error handling for such edge cases :)

Leaving this open for the Maintainers to decide and close

@eidottermihi
Copy link

I can confirm @BloodWorkXGaming workaround is indeed working:

  • forcing keycloak-js version to v15 with npm-force-resolutons
  • using a Keycloak instance thats not running on localhost

@baltom
Copy link
Contributor

baltom commented Aug 23, 2021

As mentioned on previous issues we are currently sticking to version 9.0.3 because of redhat-sso being behind keycloak. And we are not using keycloak.

In regards to better error handling, i've been trying to catch common errors. However most of them are not exposed by keycloak-js plugin. Like the CORS error is coming from the iframe which does not return errors to "us".

@baltom baltom closed this as completed Aug 23, 2021
@eidottermihi
Copy link

@baltom latest Red Hat SSO v7.5 uses Keycloak 15 (see https://access.redhat.com/articles/2342881 ) - would you mind reconsidering the decision to not upgrade the keycloak-js adapter dependency ?

Maybe by releasing a new major version v3 (so Keycloak 9 users can stick to v2)?

I'm happy to provide PRs if help is needed.

@baltom
Copy link
Contributor

baltom commented Oct 13, 2021

Update keycloak-js dependency merged and published in version 2.1.0-beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants