1

I'am using the angular-oauth2-oidc libary with keycloak as an Auth-Provider in my angular app. Everything works fine in the "happy-path":

  1. User hits the login button
  2. Calling the initImplicitFlow method
  3. The keycloak login-page shows up
  4. User enters his credentials
  5. Redirection to angular-app

But when the user clicks the back-navigation button from the browser on the Keycloak-page and then again tries to log in by hitting the login-button in the angular-app, nothing happens. No redirection to Keycloak. Only when I'm realoading the page or manually navigate to the app-root it works again.

This behaviour only occurs in the Firefox and works fine in Chrome or even Internet Explorer or Edge. Perhaps someone knows an solution to it :)

My authConfig:

export const authConfig: AuthConfig = {
  // Url of the Identity Provider
  issuer: AppSettings.AUTH_SERVER,

  // URL of the SPA to redirect the user to after login
  redirectUri: window.location.origin + "/index.html",

  // The SPA's id. The SPA is registerd with this id at the auth-server
  clientId: "angular-app-1",

  showDebugInformation: true,

  silentRefreshRedirectUri: window.location.origin + "/silent-refresh.html",

  // set the scope for the permissions the client should request
  // The first three are defined by OIDC. The 4th is a usecase-specific one
  scope: "openid profile email dashboardapi_user"
};

I don't know if has anything to do with the problem, but I'am using the HashLocationStrategy for routing.

I'm also using Angular 6, Keycloak version 3.2.1.Final and the angular-oauth2-oidc version 4.0.2

Janbo
  • 11
  • 3
  • Do you have any logs in the browser console? Try with firefox in incognito mode. It might be some cache issue. – Aritz Jul 19 '18 at 20:32
  • Been there, done that. Still nothing changed. Somehow after i navigate back no functions work that angular would provide. – Janbo Jul 24 '18 at 11:31
  • Don't think the problem is in any of the code in the question. Any chance you can make a minimal repro starting from `ng new` so we can reproduce things? (On a long shot, today I noticed one specific issue in our own app that also only didn't work in Firefox: `location.href = location.href;`. Only in FF doesn't that doe anything, in other browsers it does. Turns out `location.reload();` was the solution. Maybe that helps.) – Jeroen Jul 26 '18 at 20:10

0 Answers0