Keycloak: Receiving a “Invalid parameter: redirect_uri” when reloading the page manually

0 viewsangularkeycloak
0

It’s an Angular 17 SPA Application. And it’s using the currently most recent version of keycloak-angular (at time of writing 15.2.1) It’s something that I simply do not understand. In the default setup, I can authenticate just fine and logout. But if I dare reload the page, the entire page bricks and on inspection I noticed I receive a 400 Bad Request error. "Invalid parameter: redirect_uri" it says. But why?

My configuration looks for the most part the same as the example from the project, so I do not understand what the issue could be.

enter image description here

function initializeKeycloak(keycloak: KeycloakService) {
  return () =>
    keycloak.init({
      config: {
        url: 'https://local.dev.auth/',
        realm: 'my-test',
        clientId: 'my-app'
      },
      initOptions: {
        flow: 'standard',
        onLoad: 'check-sso',
        silentCheckSsoRedirectUri:
          window.location.origin + 'ui/assets/silent-check-sso.html'
      }
    });
}

For my testing purposes, I even kept the locally running docker instance of keycloak dirt simple

enter image description here