Skip to end of metadata
Go to start of metadata

Here is a small piece of code that can help troubleshoot problems with getting a SSO ticket from a Ticket Issuing System

publicString getSSOTicket(String portalServerHost,intportalServerPort, String portalUser, String portalPassword)throwsException{

String ticket =null;

// Create the URL instance to the ticket issuing system

URL url =newURL("https://"portalServerHost":"portalServerPort"/irj/portal?j_user="portalUser"&j_password="+ portalPassword); URLConnection connection = url.openConnection();


intresponseCode = ((HttpURLConnection) connection).getResponseCode();

if(responseCode == HttpURLConnection.HTTP_OK){

                          String headerName =null;

                          for(inti=1; (headerName = connection.getHeaderFieldKey() )!=null; i++){


                                              String cookie = connection.getHeaderField() ;

                                              if(cookie.indexOf("MYSAPSSO2") != -1)    

                                               ticket = cookie.substring(cookie.indexOf('=') + 1,  cookie.indexOf(';');                                    
                                               break; {}    




return  ticket;


This method takes the following as arguments

        Portal / issuing system's host and port

        Portal / issuing system's user and password

Method will return the issued ticket else null

  • No labels