i found many different ways write xacml request in java using xacmlinfo , wso2 libraries, no way on how define attribute category "id". request i'm trying write following:
<request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" combineddecision="true" returnpolicyidlist="true"> <attributes category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" id="action1"> <attribute attributeid="urn:oasis:names:tc:xacml:1.0:action:action-id" includeinresult="true"> <attributevalue datatype="http://www.w3.org/2001/xmlschema#string">read</attributevalue> </attribute> </attributes> <attributes category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" id="action2"> <attribute attributeid="urn:oasis:names:tc:xacml:1.0:action:action-id" includeinresult="true"> <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" id="subject1"> <attribute attributeid="urn:oasis:names:tc:xacml:1.0:subject:subject-id" includeinresult="true"> <attributevalue datatype="http://www.w3.org/2001/xmlschema#string">bart</attributevalue> </attribute> </attributes> <attributes category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" id="subject2"> <attribute attributeid="urn:oasis:names:tc:xacml:1.0:subject:subject-id" includeinresult="true"> <attributevalue datatype="http://www.w3.org/2001/xmlschema#string">admin</attributevalue> </attribute> </attributes> <multirequests> <requestreference> <attributesreference referenceid="subject1"/> <attributesreference referenceid="action2"/> </requestreference> <requestreference> <attributesreference referenceid="subject2"/> <attributesreference referenceid="action1"/> </requestreference> </multirequests> </request>
how can set attributes id referenced multirequest? code :
requestdto requestdto = new requestdto(); requestdto.setcombineddecision(true); requestdto.setreturnpolicylist(true); requestdto.setmultiplerequest(true); attributedto subjectdto = new attributedto(); subjectdto.setattributeid("urn:oasis:names:tc:xacml:1.0:subject:subject-id"); subjectdto.setattributevalue(new string[] { jsonsingleaccess.getsubject().getusername() }); subjectdto.setdatatype("http://www.w3.org/2001/xmlschema#string"); requestdto.setattributedtos("urn:oasis:names:tc:xacml:1.0:subject-category:access-subject", new attributedto[] { subjectdto }); string req = ""; try { req = peputils.createrequest(requestdto); } catch (pepagentexception e) { e.printstacktrace(); } system.out.println(req);
many all, antonio
Comments
Post a Comment