我使用angular-auth-oidc-client lib来验证我的应用程序,使用keycloak作为身份服务器。我能够登录到该应用程序,但是注销功能不起作用。我已经阅读了文档,并使用了相同的注销调用,但它似乎不起作用。请帮帮忙。提前谢谢。
下面是我的配置:
{
"sts_server": "http://localhost/auth/realms/test",
"redirect_url": "http://localhost:4200/app/",
"client_id": "test_client",
"response_type": "code",
"scope": "openid profile email",
"post_logout_redirect_uri": "http://localhost:4200/app/#/homepage/",
"startup_route": "/homepage/welcome",
"start_checksession": "true",
"silent_renew": "true",
"silent_renew_url": "assets",
"max_id_token_iat_offset_allowed_in_seconds": "10",
"logLevel": "info",
"forbidden_route": "/unauthorized",
"unauthorized_route": "/unauthorized"
}我的注销方法:
logOut() {
this.oidcSecurityService.logoffLocal();
this.oidcSecurityService.logoffAndRevokeTokens();
this.oidcSecurityService.logoff();
// none of the three mentioned above work.
}发布于 2021-01-31 19:01:18
将注销url添加到配置
logoutUrl: 'https://${your url logout}/Logout',在组件中使用
import { OAuthService } from 'angular-oauth2-oidc';
constructor(private oauthService: OAuthService,) {}
logOut() {
this.oauthService.logOut();
}https://stackoverflow.com/questions/64239572
复制相似问题