如何从请求中检索资源:SampleresourceFindermodule中的root-Resource-ID



我有一个场景,我在其中发送资源:root-resource-id从请求如下

<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="true">
        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
            Customer
        </AttributeValue>
    </Attribute>
    <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:root-resource-id" IncludeInResult="true">
        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
            Customer
        </AttributeValue>
    </Attribute>
    <Attribute AttributeId="urn:oasis:names:tc:xacml:2.0:resource:scope" IncludeInResult="false">
        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
            Descendants
        </AttributeValue>
    </Attribute>
</Attributes>`

现在,我必须像访问资源:resource-id:

一样
if("Customer".equals(parentResourceId.encode())){}

您能告诉我我如何做到这一点?

我不确定您要准确地做什么以及您的确切问题是什么。我想您正在尝试使用wso2is进行分层资源配置文件,如下所述。似乎您已经通过实现" PipResourceFinder"写了新的扩展名。此扩展的想法是在给定的根源资源下检索儿童或后代资源。因此,在XACML请求中,您需要发送根源和范围(儿童或后代)。

然后由" urn:oasis:name:tc:xacml:1.0:resource:resource-id"属性ID标识。(不是" urn:oasis:name:tc:xacml:1.0:资源:root-resource-id"属性ID ..我猜博客文章有一些错误。根据博客文章中的情况,它可能需要发送具有不同属性ID的根资源)。

范围由" urn:oasis:name:tc:xacml:2.0:resource:scope:scope"属性ID。

识别。

最后,您可以访问" PipResourceFinder"查找器中的根资源。然后,您可以返回与根资源相关的子资源。您可以通过此博客中提到的示例实现。

相关内容

  • 没有找到相关文章

最新更新