如何从我的WSO2身份服务器获取授权?
我正在尝试对WSO2 Identity Server中的策略使用AuthenticationService操作GetAuthenticationDatAttributes。我希望,如果我只传入一个subject_id(角色名称),我就可以得到适用于该角色的资源和操作,但我没有得到任何匹配项。在下面提供的示例中,我希望返回资源“EchoService”和操作“read”。我正在使用WSO2 IS 4.1.0和默认策略和属性查找程序。有人能告诉我需要做什么才能从我的WSO2身份服务器获得授权吗 谢谢, 卡特里娜飓风 请求如下:如何从我的WSO2身份服务器获取授权?,wso2,entitlements,wso2is,Wso2,Entitlements,Wso2is,我正在尝试对WSO2 Identity Server中的策略使用AuthenticationService操作GetAuthenticationDatAttributes。我希望,如果我只传入一个subject_id(角色名称),我就可以得到适用于该角色的资源和操作,但我没有得到任何匹配项。在下面提供的示例中,我希望返回资源“EchoService”和操作“read”。我正在使用WSO2 IS 4.1.0和默认策略和属性查找程序。有人能告诉我需要做什么才能从我的WSO2身份服务器获得授权吗 谢谢
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<getEntitledAttributes xmlns="http://org.apache.axis2/xsd" xmlns:ns2="http://dto.entitlement.identity.carbon.wso2.org/xsd">
<subjectName>Manager</subjectName>
<resourceName/>
<subjectId/>
<action/>
<enableChildSearch>true</enableChildSearch>
</getEntitledAttributes>
</soapenv:Body>
</soapenv:Envelope>
经理
真的
以下是应评估的政策之一:
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="EchoServicePolicy" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" Version="1.0">
<Target>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Manager</AttributeValue>
<AttributeDesignator AttributeId="http://wso2.org/claims/role" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator>
</Match>
</AllOf>
</AnyOf>
</Target>
<Rule Effect="Permit" RuleId="Rule-1">
<Target>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">EcoService</AttributeValue>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator>
</Match>
</AllOf>
</AnyOf>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator>
</Match>
</AllOf>
</AnyOf>
</Target>
</Rule>
<Rule Effect="Deny" RuleId="Rule-2">
<Target>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">EcoService</AttributeValue>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator>
</Match>
</AllOf>
</AnyOf>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">write</AttributeValue>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator>
</Match>
</AllOf>
</AnyOf>
</Target>
</Rule>
</Policy>
经理
生态服务
阅读
生态服务
写
此方法允许应用程序根据XACML PDP动态检查可以访问的资源。根据XACML核心规范,它只讨论可以提供布尔值授权结果的PDP(基本上允许、拒绝、不适用、不确定的结果和一些使用建议和义务的附加数据)。基本上,从PDP开始,应用程序(PEP)可以问“用户有权这样做吗?”之类的问题,而应用程序(PEP)不能问“给定用户允许的资源和操作是什么?”此方法提供了该功能。您可以从中找到更多详细信息,还可以尝试一个示例