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

Always Redirect with URL #error=login_required #164

Open
raksakaindra opened this issue Feb 26, 2023 · 4 comments
Open

Always Redirect with URL #error=login_required #164

raksakaindra opened this issue Feb 26, 2023 · 4 comments

Comments

@raksakaindra
Copy link

raksakaindra commented Feb 26, 2023

Hello,
I found an issue when accessing the homepage with Keycloak auth, it always redirects to the URL #error=login_required.
I'm using init like this on Vue3:

init: {
      // Use 'login-required' to always require authentication
      // If using 'login-required', there is no need for the router guards in router.js
      onLoad: "check-sso",
      silentCheckSsoRedirectUri:
        window.location.origin + "/silent-check-sso.html",
    },

The issue is similar at Stackoverflow https://stackoverflow.com/questions/73627290/react-keycloak-js-error-login-required-loop-when-accessing-home-page. The difference is on Stackoverflow using react-keycloak.

I hope this issue can be solve. Thanks

@cdecinkoKnight
Copy link

Has any progress been made on this? We are seeing this as well. Coming to the app for the first time, home page you immediately get that error in the address bar. We are using the latest 2.2.0 version

@claussma
Copy link

I have the same problem. Continuous loop when I use onLoad: 'check-sso'.

Can you please add an example where the function is implemented correctly? I don't want to use the Keykloack login window, but a separate form. I need to distribute the logins to different servers and realms depending on the domain.

@IgorCSilva
Copy link

IgorCSilva commented Mar 6, 2024

I have this problem too, but only when I access the page in chrome private window. When I access in a firefox private window it is all ok.

The error in chrome console:

Error: Failure during initialization of keycloak-js adapter
    at @dsb-norge_vue-keycloak-js.js?v=96f17145:2194:19 {error: 'login_required', error_description: undefined}

(anonymous)	@	@dsb-norge_vue-keycl….js?v=96f17145:2096
fulfilled	@	@dsb-norge_vue-keycl….js?v=96f17145:2061
Promise.then (async)		
step	@	@dsb-norge_vue-keycl….js?v=96f17145:2074
(anonymous)	@	@dsb-norge_vue-keycl….js?v=96f17145:2076
__awaiter	@	@dsb-norge_vue-keycl….js?v=96f17145:2058
install	@	@dsb-norge_vue-keycl….js?v=96f17145:2084
use	@	chunk-EYMNJ3H6.js?v=96f17145:5137
(anonymous)	@	main.ts:27

and in my main.ts file:

app.use(VueKeyCloak, {
  init: {
    // Use 'login-required' to always require authentication
    // If using 'login-required', there is no need for the router guards in router.js
    onLoad: 'check-sso',
    silentCheckSsoRedirectUri: window.location.origin + "/silent-check-sso.html"
  },
  config: {
    realm: keycloakObj.realm,
    url: keycloakObj.url,
    clientId: keycloakObj.clientId
  }
})

When I refresh the page I am in a continuous loop too.

@desian78
Copy link

This issue still exist.
I run into the same issue.
Same Angular-Config like the comment above.
On npm run serve => all ok, can login everything..
On nginx-vhost "test.localhost" proxy on this "localhost:4200" => permanent redirecting back and forth between keycloak (running also on localhost) and the webserver.
Any solutions?

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

5 participants