Ich verwende WSO2IS 5.3.0 und ich habe die Anweisungen auf dieser Website folgen: https://docs.wso2.com/display/IS530/Writing+a+Custom+Policy+Info+PointWSO2 Identity Server - Senden mehrere Attribute in der Anfrage an eine benutzerdefinierte Richtlinie Info Point (PIP) in WSO2IS
I‘ erfolgreich den benutzerdefinierten PIP-Attribut-Finder (KMarketJDBCAttributeFinder) implementiert, so weit so gut. Das Problem, das ich habe, ist, dass ich mehr als ein Attribut senden möchte, aber der AttributeFinder wählt nur einen aus. Als nächstes meine Politik und Anfrage:
XACML Politik:
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xacml="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
PolicyId="My-Custom-Policy"
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-regexp-match">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">subj-id</AttributeValue>
<AttributeDesignator
MustBePresent="false"
Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
</Match>
</AllOf>
</AnyOf>
</Target>
<Rule RuleId="rule1" Effect="Permit">
<Target>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">action-value</AttributeValue>
<AttributeDesignator
MustBePresent="false"
Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action"
AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
</Match>
</AllOf>
</AnyOf>
</Target>
<Condition>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:any-of">
<Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"/>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">some-value-returned-by-custom-pip-finder-jar</AttributeValue>
<AttributeDesignator
Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource"
AttributeId="urn:my:custom:id:data-one"
DataType="http://www.w3.org/2001/XMLSchema#string"
MustBePresent="false"/>
</Apply>
</Condition>
</Rule>
<Rule RuleId="rule2" Effect="Deny"/>
</Policy>
XACML Anfrage:
<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" CombinedDecision="false" ReturnPolicyIdList="false">
<Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" IncludeInResult="false">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">subj-id</AttributeValue>
</Attribute>
</Attributes>
<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">action-value</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">re-src-id</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:my:custom:id:data-one" IncludeInResult="false">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">data-one</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:my:custom:id:data-two" IncludeInResult="false">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">data-two</AttributeValue>
</Attribute>
</Attributes>
</Request>
Wie Sie sehen können, ich schicke drei Attribute als Teil der Ressourcenkategorie; aber wenn ich den Code debuggen, ich sehe nur, dass eines dieser Attribute aufgenommen wird (die anderen werden ignoriert)
Auch aus der Anfrage und Politik, die ich verwendet haben Zoll AttributeID: urn:my:custom:id:data-one
und urn:my:custom:id:data-two
¿Wie kann ich mehrere Attribute senden (ohne die Option "Mehrere Anfragen" zu verwenden, ich möchte nur eine einzige Anfrage senden) und bestätige, dass alle Attribute korrekt von meiner benutzerdefinierten attributeFinder PIP-Erweiterung erhalten werden?