【发布时间】:2021-04-21 07:56:04
【问题描述】:
?我通过“@auth0/angular-jwt”获得了我的 Angular 10 应用程序 JWT 令牌。在解码函数后,我得到一个声明列表,如下所示:
{
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name: "johndoe",
http://schemas.microsoft.com/ws/2008/06/identity/claims/role: "Manager",
exp: 1525510870,
iss: "http://localhost:5000",
aud: "http://localhost:5000"
}
我如何通过 typescript 获得自定义声明,例如:
{
name: "johndoe",
role: "Manager",
}
? 谢谢。
【问题讨论】:
标签: angular decode auth0 jwt-auth claims