Showing posts with label Fedlet. Show all posts
Showing posts with label Fedlet. Show all posts

Saturday, June 1, 2013

Feldet error : "java.lang.ExceptionInInitializerError"

I have completed the SP initiated SSO integration with IDP partner using Fedlet as Service Provider. Later, when I moved the fedlet configuration directory to a different location, it is throwing the below exception:

java.lang.ExceptionInInitializerError
at jsp_servlet._saml2._jsp.__fedletssoinit._jspService(__fedletssoinit.java:132)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
Truncated. see log file for complete stacktrace
Caused By: java.lang.NullPointerException


Changes I made:
  • Moved the fedlet configuration directory to a different location.
  • Updated the startWebLogic.sh script to include the new fedlet home as shown below.
JAVA_OPTIONS="${JAVA_OPTIONS} -Dcom.sun.identity.fedlet.home=/apps/tap/Oracle1036/user_projects/domains/tap_pit1/config/fedlet"
export JAVA_OPTIONS
  • Restart the WebLogic server.
  • Access the fedlet SP initiated SSO URL.
Troubleshooting:
Upon starting the weblogic server, the new fedlet home is not visible as JAVA_OPTIONS.

Fix:
  • Update startWebLogic.sh script to include fedlet home parameter directly in java execution line as shown below. Update in the same manner in all the other java execution lines present in the script.
echo "${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} -Dcom.sun.identity.fedlet.home=${DOMAIN_HOME}/config/fedlet ${PROXY_SETTINGS} ${SERVER_CLASS}"
  • Restart the WebLogic server. Make sure that fedlet home appears in java options by using ps -ef | grep java

Wednesday, May 29, 2013

Customizing Fedlet

I have been working on fedlet a lot these days. The greatest advantage of using fedlet is the customization. Since it is open source product, the jars available from fedlet application allows us to customize the federation process. It is also more useful to integrate with Custom IDPs.

The important jar files are:
openfedlib.jar
opensso-sharedlib.jar

These jars are present in fedlet sample application generated during fedlet setup. The major java files where customization can be made are:

SPSSOFederate.java generates the SAML Authentication request.
SPACSUtils.java processes the SAML response.
SAML2Utils.java verifies the response for validity of SAML response and assertion, signature and encryption.

Once these java files are modified appropriately, compile the class file and put the class file back to openfedlib.jar. Place the jar under application WEB-INF/lib folder and restart the application server (where fedlet is deployed) for changes to take into effect.

If you get any exceptions in fedlet, you can look for libSAML2.properties file located under WEB-INF/classes for all mapped error scenarios.

For example, while testing the SAML SSO, if  you see exception "Version is not present in the request" then look for mapped error in the libSAML2.properties file. Then search in fedlet java classes where missingVersion error is thrown.
missingVersion=Version is not present in the request.


Let me know if you need assistance to customize any specific functionality with fedlet, I can help you.