在wso2身份服务器中,如何验证Ouath2令牌并获取用户属性

时间:2020-08-06 05:05:01

标签: wso2 wso2is

在wso2身份服务器5.10.0中,获取访问令牌后,我想验证OAuth2令牌以检查是活动的还是非活动的,然后在验证之后,我想按令牌获取用户的用户属性(声明)。我知道如何获得用于令牌验证(https://is.docs.wso2.com/en/latest/learn/oauth-token-validation-using-soap-service/)的SOAP API,但是它仅返回令牌验证结果,而不会返回有关用户属性的任何其他信息。

1 个答案:

答案 0 :(得分:0)

您可以使用OpenId connect userinfo端点获取用户属性。

curl -k -H "Authorization: Bearer <Acess_token>" https://localhost:9443/oauth2/userinfo?schema=openid

请求令牌时,您应该要求令牌的openid范围。

https://is.docs.wso2.com/en/latest/learn/basic-client-profile-with-playground/