WSO2 - IS 5.1.0.x - 在 JWT Payload 中返回 formattedName

问题描述

如何在 JWT 负载中返回属性“name.formatted”?

这是我的声明配置:

enter image description here

这是个人资料:

enter image description here

现在,服务提供商的声明配置:

enter image description here

这是 JWT 负载

enter image description here

请注意,即使我将 formattedname 启用为“支持”并将其添加到服务提供商的声明中,它也不会添加到 JWT。其他属性,例如“family_name”。

我错过了什么?

提前致谢!

解决方法

要获取 ID 令牌中返回的自定义声明,需要将声明映射到 OIDC 声明并添加到 OIDC 范围。你可以参考 [1] 来了解如何做到这一点。

[1] https://medium.com/@inthiraj1994/lets-add-a-custom-claim-to-oidc-in-wso2-is-d871e418d6b0