我正在尝试对我的WSO2 Identity服务器中的策略使用EntitlementService操作GetEntitledAttributes。我期望如果我发出这个调用,只传入一个subject_id (角色名),我应该得到适用于该角色的资源和操作,但我根本得不到任何匹配。在下面提供的示例中,我希望得到资源"EchoService“和操作"read”。我使用带有默认策略和属性查找器的WSO2 IS 4.1.0。谁能告诉我需要做些什么才能从我的WSO2 Identity服务器中获得权利?
谢谢,
卡特里娜飓风
这是请求:
<?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> 发布于 2013-11-25 22:54:09
这种方法允许应用程序根据XACML核心规范的动态manner.According中的XACML PDP检查哪些资源可以访问,它只讨论能够提供布尔值的授权结果的PDP (基本上是允许、拒绝、不适用、不确定的结果和一些使用建议和义务的附加数据)。基本上,在PDP中,应用程序(PEP)可以询问类似“用户是否有权这样做”之类的问题?而应用程序(PEP)不能问这样的问题:“给定用户允许的资源和操作是什么?”此方法提供了该功能。你可以在here上找到更多细节,还有一个你可以尝试的示例
https://stackoverflow.com/questions/18318782
复制相似问题