0 Replies Latest reply on Mar 17, 2008 1:39 PM by 807573

    Error retrieving sso token in SOAPHandler

    807573
      I am trying to access the SSO token using the following code:

      public boolean handleMessage(SOAPMessageContext context) {
      if (context != null) {
      boolean isOutbound = ((Boolean) context.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY)).booleanValue();
      if (!isOutbound) {

      try {       
      HttpServletRequest request = (HttpServletRequest) context.get(SOAPMessageContext.SERVLET_REQUEST);
      SSOToken ssoToken = SSOTokenManager.getInstance().createSSOToken(request);
      if (ssoToken != null) {
      System.out.println("SSO Token -> " + ssoToken.getTokenID().toString());
      } else {
      System.out.println("SSO Token is null");
      }
      } catch (Exception ex) {
      ex.printStackTrace();
      }
      ...

      When I execute it, I get this error:

      AMServerAuthModule.Init
      Verification successful for URI "#s73cc75f5da61b20f1b01d775f9c8786e247dd0a901"
      com.iplanet.sso.SSOException: Invalid session ID.
      at com.iplanet.sso.providers.dpro.SSOProviderImpl.createSSOToken(SSOProviderImpl.java:119)
      at com.iplanet.sso.SSOTokenManager.createSSOToken(SSOTokenManager.java:242)
      at ca.medavie.service.security.SecurityHandler.handleMessage(SecurityHandler.java:54)
      at ca.medavie.service.security.SecurityHandler.handleMessage(SecurityHandler.java:33)
      at com.sun.xml.ws.handler.HandlerProcessor.callHandleMessage(HandlerProcessor.java:292)
      at com.sun.xml.ws.handler.HandlerProcessor.callHandlersRequest(HandlerProcessor.java:135)
      ...

      Is this the proper way to retrieve the sso token within a web service?