问题描述
在本文之后,我创建了请求XACML并获得成功。 https://docs.wso2.com/display/IS560/Using+REST+APIs+via+XACML+to+Manage+Entitlement
在最后一个问题中,我看到可以使用访问令牌进行请求: WSO2is XACML API
我的问题是,是否可以使用访问令牌来接受此请求,因为当我使用基本身份验证时,我在请求中获得了成功,但是当我使用访问令牌时,我得到了403 Forbidden。
如果可以使用访问令牌发出此请求,该怎么办才能解决403问题?
解决方法
是的,您可以使用访问令牌来授权请求。如果导航到
<Resource context="(.*)/api/identity/entitlement/(.*)" secured="true" http-method="all">
<Permissions>/permission/admin/manage/identity/pep</Permissions>
<Scopes>internal_manage_pep</Scopes>
</Resource>
此配置与每个/权利端点的保护方式有关。在https://is.docs.wso2.com/en/latest/develop/authenticating-and-authorizing-rest-apis/#secure-resources
中查找更多详细信息如果您使用访问令牌,则应使用上述范围生成它。如果访问令牌没有必需的范围,您将收到403 Forbidden。为了向https://localhost:9443/api/identity/entitlement/decision/pdp
发出POST请求,您应该使用在internal_manage_pep
范围内生成的访问令牌。