在密钥斗篷上进行向后导航后,无法启动隐式流程

时间:2018-07-19 12:03:58

标签: angular firefox oauth keycloak angular-oauth2-oidc

我在我的角度应用程序中使用带有keycloak的angular-oauth2-oidc库作为Auth-Provider。 一切都在“快乐路径”中正常运行:

  1. 用户点击登录按钮
  2. 调用initImplicitFlow方法
  3. 显示密钥斗篷登录页面
  4. 用户输入其凭据
  5. 重定向到angular-app

但是,当用户在Keycloak页面上单击浏览器中的向后导航按钮,然后再次尝试通过单击angular-app中的登录按钮尝试登录时,什么也没有发生。没有重定向到Keycloak。只有当我重新加载页面或手动导航到应用程序根目录时,它才能再次起作用。

此行为仅在Firefox中发生,并且在Chrome甚至Internet Explorer或Edge中都可以正常工作。 也许有人知道解决方法:)

我的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"
};

我不知道是否与问题有关,但是我正在使用HashLocationStrategy进行路由。

我还在使用Angular 6,Keycloak3.2.1.Finalangular-oauth2-oidc4.0.2

0 个答案:

没有答案