Search code examples
authorizationaccess-controlxacmlabacwso2-identity-server

WSO2 Identity - XACML PIP extension throws org.apache.axis2.AxisFault: Exception occurred


When adding a Java PIP extension by a Java program, packed as a .jar file and using the entitlement.properties configuration line:

PIP.AttributeDesignators.Designator.2=com.ibm.carbon.pip.RedAttributeFinder

an after the server restart, the server throws an error message as followed and visible at the Web Entitlement screen:

Error while loading entitlement policies. Exception occurred while trying to invoke service method getAllPolicies
The following error details are available. Please refer logs for more details.
org.apache.axis2.AxisFault: Exception occurred while trying to invoke service method getAllPolicies
at org.wso2.carbon.identity.entitlement.ui.client.EntitlementPolicyAdminServiceClient.handleException(EntitlementPolicyAdminServiceClient.java:478)
at org.wso2.carbon.identity.entitlement.ui.client.EntitlementPolicyAdminServiceClient.getAllPolicies(EntitlementPolicyAdminServiceClient.java:81)
at org.apache.jsp.entitlement.index_jsp._jspService(org.apache.jsp.entitlement.index_jsp:183)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:155)
at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
... 

I've done a review of the examples and source code, tried several ones and also used the latest sample code published at this article https://stackoverflow.com/questions/21521796/how-to-add-user-defined-attribute-in-pip-attribute-user-store. Under all test conditions, the resulting error is always exactly the same, regardless of the code added by the extension.

Is there a technique to debug the internal error messages at the PIP engine and find the root error of this problem that inhibits the Axis service?

Status Update:

Yet, I did not have progress with the PIP extension testing. The WSO2 server as defined, is not able to fetch and load the Java extension class named "RedAttributeFinder", registered following the instruction at http://xacmlinfo.org/2011/12/18/writing-jdbc-pip-module/. We also do not see any class loader error message at the server start-up and logs, just an "AxisFault" error message as described above. The package name was modified to the name "com.red.carbon.pip".

The class was activated using the following definition in:

PIP.AttributeDesignators.Designator.2=com.red.carbon.pip.RedAttributeFinder 

Our code will use the default "subjectid" as input argument and create a list of six fields as an output. Is there a need to define the fields, the ones that were added and define it in a schema .xsd, or .xml file, and if yes, is there a documentation available? In our tests we did not use a "datasources" definiton by XML, as at that moment, there is no need for using a database service.

Question: What definitions are required to activate the configuration at the WSO2 server and load the PIP extension code and make it visible to the PDP Extension console display, or to correct the "AxisFault" error?


Solution

  • I've replaced the KmarketPIPAttributeFinder program module by the latest version from the svn source repository (see link below) and compiled it. This solved the problem under WSO2 Identity Server Version 5 and the routine started to register the PIP attributes, now visible at the PDP extensions.

    Download the module from: https://svn.wso2.org/repos/wso2/carbon/platform/trunk/components/identity/org.wso2.carbon.identity.samples.entitlement.pip/src/main/java/org/wso2/carbon/identity/samples/entitlement/pip/KmarketPIPAttributeFinder.java