首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >angular-auth-oidc-客户端注销不起作用

angular-auth-oidc-客户端注销不起作用
EN

Stack Overflow用户
提问于 2020-10-07 15:48:33
回答 1查看 2.2K关注 0票数 1

我使用angular-auth-oidc-client lib来验证我的应用程序,使用keycloak作为身份服务器。我能够登录到该应用程序,但是注销功能不起作用。我已经阅读了文档,并使用了相同的注销调用,但它似乎不起作用。请帮帮忙。提前谢谢。

下面是我的配置:

代码语言:javascript
复制
{
    "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"
}

我的注销方法:

代码语言:javascript
复制
  logOut() {
        this.oidcSecurityService.logoffLocal();
        this.oidcSecurityService.logoffAndRevokeTokens();
        this.oidcSecurityService.logoff();
// none of the three mentioned above work.
    
      }
EN

回答 1

Stack Overflow用户

发布于 2021-01-31 19:01:18

将注销url添加到配置

代码语言:javascript
复制
logoutUrl: 'https://${your url logout}/Logout',

在组件中使用

代码语言:javascript
复制
import { OAuthService } from 'angular-oauth2-oidc';
constructor(private oauthService: OAuthService,) {}
logOut() {
  this.oauthService.logOut();
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64239572

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档