Hi Farasath,

Above code works perfectly! Thankx alot for the help.

Manujith

On Tue, Jul 26, 2016 at 12:32 AM, Farasath Ahamed <[email protected]>
wrote:

> HI Manujith,
>
> You can get the required Node/Element argument to be passed to
> Balana Attributes Object using a code segment like below,
>
> try {
>     DocumentBuilderFactory documentBuilderFactory = 
> IdentityUtil.getSecuredDocumentBuilderFactory();
>
>     DocumentBuilder docBuilder = documentBuilderFactory.newDocumentBuilder();
>     ByteArrayInputStream is = new 
> ByteArrayInputStream(xacmlRequestString.getBytes());
>
>     // parse and build the document.
>
>     Document document = docBuilder.parse(is);
>     Element element = document.getDocumentElement();
>
>     // use the element in the Balana constructor
>
>
> } catch (ParserConfigurationException | UnmarshallingException | IOException 
> | SAXException e) {
>     throw new SAMLSSOException("Error in unmarshalling SAML Request from the 
> encoded String", e);
>
> }
>
>
>
> Thanks,
>
>
> Farasath Ahamed
> Software Engineer, WSO2 Inc.; http://wso2.com
> Mobile: +94777603866
> Blog: blog.farazath.com
> Twitter: @farazath619 <https://twitter.com/farazath619>
> <http://wso2.com/signature>
>
>
>
> On Mon, Jul 25, 2016 at 10:40 PM, Manujith Pallewatte <
> [email protected]> wrote:
>
>> Hi all,
>>
>> As a part of the REST API for IS AZaaS, i'm in the process of parsing
>> JSON XACML 3.0 requests into the Balana RequestCtx Objects [1], thus
>> allowing me to directly evaluate them using the engine. In that process,
>> according to the JSON profile of XACML 3.0 [2], it is stated that the
>> content section of  request should be converted sent as either a Base64
>> string or escaped XML String.
>>
>> By that the XML String is obtained, yet the Balana Attributes object [3]
>> only accepts type 'Node' as content. Thus I'm in search for a way of
>> parsing a XML String to Balana Node object, hopefully using an existing
>> method in the engine.
>>
>> Please let me know if there's any or any pointers I can work on.
>>
>> Thank You
>> Best Regards,
>> Manujith
>>
>>
>> [1]
>> https://github.com/wso2/balana/blob/master/modules/balana-core/src/main/java/org/wso2/balana/ctx/xacml3/RequestCtx.java
>> [2]
>> http://docs.oasis-open.org/xacml/xacml-json-http/v1.0/xacml-json-http-v1.0.html
>> [3]
>> https://github.com/wso2/balana/blob/master/modules/balana-core/src/main/java/org/wso2/balana/xacml3/Attributes.java
>>
>> --
>>
>>
>>
>> Manujith Pallewatte
>> [image: https://]about.me/manzzup
>>
>> <https://about.me/manzzup?promo=email_sig&utm_source=email_sig&utm_medium=external_link&utm_campaign=chrome_ext>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>


-- 



Manujith Pallewatte
[image: https://]about.me/manzzup
<https://about.me/manzzup?promo=email_sig&utm_source=email_sig&utm_medium=external_link&utm_campaign=chrome_ext>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to