Skip to Content.
Sympa Menu

mace-opensaml-users - RE: [OpenSAML] Attribute Values in XACMLAuthzQuery

Subject: OpenSAML user discussion

List archive

RE: [OpenSAML] Attribute Values in XACMLAuthzQuery


Chronological Thread 
  • From: "Rachana Ananthakrishnan" <>
  • To: <>
  • Subject: RE: [OpenSAML] Attribute Values in XACMLAuthzQuery
  • Date: Mon, 2 Jun 2008 09:44:12 -0500


Hakon,

Thanks, I fixed it to be XACML attributes, but still unable to get the
attribute value. Here is the output as it is now:

Resource list size: 1

Resource:<xacml-context:Resource
xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os"><xacml-
context:Attribute AttributeId="http://www.globus.org/xacml/service-endpoint
<blocked::http://www.globus.org/xacml/service-endpoint> "
DataType="http://www.w3.org/2001/XMLSchema#string
<blocked::http://www.w3.org/2001/XMLSchema#string> "
Issuer="issuer"><xacml-context:AttributeValue
xmlns:xs="http://www.w3.org/2001/XMLSchema
<blocked::http://www.w3.org/2001/XMLSchema> "
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<blocked::http://www.w3.org/2001/XMLSchema-instance> "
xsi:type="xs:string">https://192.168.1.100:1883/wsrf/services/xacml/TestServ
ice</xacml-context:AttributeValue></xacml-context:Attribute><xacml-context:A
ttribute AttributeId="urn:globus:4.0:container:service-name"
DataType="http://www.w3.org/2001/XMLSchema#string
<blocked::http://www.w3.org/2001/XMLSchema#string> "
Issuer="Issuer"><xacml-context:AttributeValue
xmlns:xs="http://www.w3.org/2001/XMLSchema
<blocked::http://www.w3.org/2001/XMLSchema> "
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<blocked::http://www.w3.org/2001/XMLSchema-instance> "
xsi:type="xs:string">https://192.168.1.100:1883/wsrf/services/xacml/TestServ
ice</xacml-context:AttributeValue></xacml-context:Attribute></xacml-context:
Resource>

Resource Attribute size: 2

Resource Attribute value size: 0

Resource Attribute value size: 0

The output is from the same code snippet I pasted before.

Thanks,
Rachana


________________________________

From:


[mailto:]
On Behalf Of
Håkon Sagehaug
Sent: Monday, June 02, 2008 3:24 AM
To:

Subject: Re: [OpenSAML] Attribute Values in XACMLAuthzQuery


Hi

See inline


2008/5/30 Rachana Ananthakrishnan
<>:


I am having issues with extracting AttributeValue from
XACMLAuthzQuery using
OpenSAML 2.1. The getAttributeValue() on ResourceType,
SubjectType and
ActionType retutns an empty list. The DOM element looks
accurate. I
construct the object using:

// Construct XACMLAuthorizationDecisionQuery from Element
UnmarshallerFactory marshallerFactory =

org.opensaml.xml.Configuration.getUnmarshallerFactory();
Unmarshaller requestUnmarshaller =


marshallerFactory.getUnmarshaller(XACMLAuthzDecisionQueryType.
DEFAULT_ELEMENT_NAME_XACML20);
XACMLAuthzDecisionQueryType queryRequest = null;
try {
queryRequest =
(XACMLAuthzDecisionQueryType)requestUnmarshaller.
unmarshall(queryElement);
} catch (UnmarshallingException e) {
e.printStackTrace();
throw new RemoteException(e.getMessage());
}

The code snippet that parses resource:

// Parse the request
List resources = request.getResources();
System.out.println("Resource list size: " +
resources.size());
Iterator resIter = resources.iterator();
while (resIter.hasNext()) {
ResourceType resourceType =
(ResourceType)resIter.next();
System.out.println("Resource:" +

XmlUtils.toString(resourceType.getDOM()));
Iterator resValue =
resourceType.getAttributes().iterator();
System.out.println("Resource Attribute size: " +
resourceType.getAttributes().size());
while (resValue.hasNext()) {
AttributeType attrType =
(AttributeType)resValue.next();
System.out.println("Resource Attribute value
size: " +

attrType.getAttributeValues().size());
}
}

Resource list size: 1 Resource:<xacml-context:Resource

xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os"><xacml-
context:Attribute
AttributeId="http://www.globus.org/xacml/service-endpoint";
DataType="http://www.w3.org/2001/XMLSchema#string";
Issuer="issuer"><saml:AttributeValue
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

xsi:type="xs:string">https://192.168.1.100:8443/wsrf/services/SecureCounterS
ervice</saml:AttributeValue>


Here you have a SAML Attribute value, should it not be a xacml
attribute value, something like this

<xacml-context:Resource>
<xacml-context:Attribute
AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
DataType="http://www.w3.org/2001/XMLSchema#string";>

<xacml-context:AttributeValue>http://bccs.uib.no/</xacml-context:AttributeVa
lue></xacml-context:Attribute>
</xacml-context:Resource>

cheers Håkon






Archive powered by MHonArc 2.6.16.

Top of Page