node.js + XACML wso2is


cd WSO2IS_HOME
subl wso2is-4.5.0/repository/conf/carbon.xml
HideAdminServiceWSDLs -> false

./bin/wso2server.sh

npm install soap
mkdir wso2is-nodejs
cd wso2is-nodejs/
subl soap-clinet.js

process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';

var soap = require('soap');
var url = 'https://localhost:9444/services/EntitlementService?wsdl';
var args = {subject:'admin',
resource:'http://localhost:9766/services/RestService/POST',
action:'POST'
};
soap.createClient(url, function(err, client) {
client.setSecurity(new soap.BasicAuthSecurity('admin', 'admin'));
client.getDecisionByAttributes(args, function(err, result) {
console.log(result.statusCode);
console.log(result.body);
});
});

node soap-clinet.js

200
<Response xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"><Result><Decision>Permit</Decision><Status><StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:ok"/></Status></Result></Response>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s