简体   繁体   中英

After upgrade of keycloak, angular 13 app gets redirect error on logout

My Keycloak server has been upgraded to 20.0.2, so in my angular 13 app, I've installed keycloak-js 18.0.1 and keycloak-angular 10.0.2. I can't go up to keycloak-js 20 because it would require angular 15 and we're not ready to do that.

So, I've read from different sites that upgrading to keycloak-js 18 would solve my logout error, but I still get the same error. The Valid redirectURIs is set to http://localhost:4200/* in the admin console.

In the code I call:

this.keycloakService.logout();

The logout URL issued is:

http://localhost:8010/realms/<snip>/protocol/openid-connect/logout?post_logout_redirect_uri=http://localhost:4200/&id_token_hint=<token>

The response is:

We are sorry... Invalid redirect uri

I've been reading about this all day and I'm losing hope. Does anyone know what might be going on?

I learned that the server admin client option Valid post logout redirect URIs needs also to be set to http://localhost:4200, then it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM