Monday, October 12, 2015

Launch TNPM pages in context from external applications

If you ever needed to integrate TNPM (v1.3.2+) with an external application, you may have asked yourself how to launch the TNPM portal in context with authentication and authorization in place.

It turns out there is a portal tool that allows exactly that. Is it called xlaunch and it is available for TIP and JAZZ portals. The tool will create a user-based token that can be used authenticate and launch the TNPM page you wanted using HTTP GET.

Steps:


1) Create the xlaunch credentials (all in one line):
 
$ java -cp /<JazzSM_HOME>/profile/installedApps/JazzSMNode01Cell/isc.ear/xlaunchapi.jar com.ibm.isc.api.xlaunch.LaunchPropertiesHelper\$Encode com.ibm.isc.xlaunch.username <username> com.ibm.isc.xlaunch.password <password>

Replace <username> and <password> with the TNPM user you want to SSO.

This will return a string like:

L2NvbS5pYm0uaXNjLnhsYXVuY2gujXNlcm5hbWUvdG5wbS1jb20uaWJtLmlzYy5KbGF1bmNoLnBhc3N3b3JkL3RucG0*

2) Launch in context (autologin using xlaunch credentials)
       
URL: https://<serverip>:16311/ibm/action/launch/<pageid>/<xlaunch_credential>

Example:
https://1.2.3.4:16311/ibm/action/launch/tnpm.console.topology.performance.network.resourceGroups/L2NvbS5pYm0uaXNjLnhsYXVuY2gujXNlcm5hbWUvdG5wbS1jb20uaWJtLmlzYy5KbGF1bmNoLnBhc3N3b3JkL3RucG0*

To get the pageid, open the page in JAZZ, click on the "single page" icon on the top right corner and click "About". Under "General" you will find the pageid

3) That's it