我在我的角度应用程序中使用带有keycloak的angular-oauth2-oidc库作为Auth-Provider。 一切都在“快乐路径”中正常运行:
但是,当用户在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,Keycloak版3.2.1.Final和angular-oauth2-oidc版4.0.2