0

我有一个策略,当我在 WSO2 身份服务器中运行请求时,我得到了预期的许可决定。但是当我从以下位置创建另一个示例策略时:

http://svn.wso2.org/repos/wso2/carbon/platform/tags/4.0.7/products/is/4.1.0/modules/distribution/conf/policies/sample-kmarket-sliver-policy.xml

并再次发送我的相同请求,我收到以下错误:

<Response xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17">
   <Result>
      <Decision>Indeterminate</Decision>
      <Status>
        <StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:missing-attribute"/>
        <StatusMessage>Couldn't find AttributeDesignator attribute</StatusMessage>
        <StatusDetail>
          <MissingAttributeDetail AttributeId="http://kmarket.com/id/role" DataType="http://www.w3.org/2001/XMLSchema#string" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" ></MissingAttributeDetail>
        </StatusDetail>
      </Status>
   </Result>
</Response>

出于某种原因,请求正在针对此示例策略而不是我的原始策略运行。现在有趣的是,我下载了 Balana(WSO2 身份服务器使用的 XACML 引擎)源代码并使用策略和我的请求运行测试,并且我按预期获得了许可。但是当我在 WSO2 中做同样的事情时,它不起作用,我得到了不确定的错误。我尝试了“试用”功能和“使用 PDP 评估”,结果相同。

这是我使用的请求,为什么将其应用于示例策略而不是通过 WSO2 而不是 Balana 的原始策略?

<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" CombinedDecision="false" ReturnPolicyIdList="false">
    <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="false">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">write</AttributeValue>
        </Attribute>
    </Attributes>

    <Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
        <Attribute AttributeId="urn:samhsa:names:tc:company:1.0:subject:provider-npi" IncludeInResult="false">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">1548797430</AttributeValue>
        </Attribute>
    </Attributes>

    <Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject">
        <Attribute AttributeId="urn:samhsa:names:tc:company:1.0:subject:provider-npi" IncludeInResult="false">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">1347570297</AttributeValue>
        </Attribute>
    </Attributes>

    <Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:purpose-of-use">
        <Attribute AttributeId="urn:samhsa:names:tc:company:1.0:purpose-of-use-code" IncludeInResult="false">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">TREAT</AttributeValue>
        </Attribute>
    </Attributes>

    <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="false">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">@outlook.com</AttributeValue>
        </Attribute>
    </Attributes>

    <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment">
        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:environment:current-dateTime" IncludeInResult="false">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#dateTime">2013-07-12T00:00:00-04:00</AttributeValue>
        </Attribute>
    </Attributes>

</Request>
4

1 回答 1

0

根据错误,似乎没有配置属性查找器。我猜策略有一个名为“ http://kmarket.com/id/role ”的属性id,但它不在请求中,所以调用了属性查找器。您需要注册一个属性查找器来支持它...请从此处找到示例属性查找器 [1]。在 balana 样本中,这个属性查找器已经与样本本身一起存在

[1] http://svn.wso2.org/repos/wso2/carbon/platform/tags/4.0.7/components/identity/org.wso2.carbon.identity.samples.entitlement.pip/

于 2013-08-02T08:39:48.737 回答