CA Service Management

Expand all | Collapse all

Implement loginServiceManaged challenge

  • 1.  Implement loginServiceManaged challenge

    Posted Mar 07, 2018 07:59 PM

    New installation of SDM r17.1 (not an upgrade).

    Testing the loginServiceManaged capability.

    Followed the document found in $NX_ROOT\samples\sdk\websvc\java\test1_pki

    • Generated the Stub Classes using build_wsdl.bat

    C:\PROGRA~2\CA\SERVIC~1\bopcfg\www\CATALINA_BASE\webapps\axis>build_wsdl.bat
    Mar 07, 2018 2:10:50 PM org.apache.axis.utils.JavaUtils isAttachmentSupported
    WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    Note: classes\com\ca\www\UnicenterServicePlus\ServiceDesk\USD_WebServiceSoapSoapBindingStub.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.

    • Stopped and restarted Tomcat
    • Ran pdm_pki -p DEFAULT -f which generated the DEFAULT.p12 file
    • Edited the Web Services Policy to link to Proxy Contact "ServiceDesk" and verified it shows having a key.
    • Copied the DEFAULT.p12 file to $NX_ROOT\bopcfg\www\CATALINA_BASE\webapps\axis directory
    • Copied pkilogin.htm and pkilogin.jsp to $NX_ROOT\bopcfg\www\CATALINA_BASE\webapps\axis directory

    When I run the test using http://localhost:8080/axis/pkilogin.htm I get the following error from pkilogin.jsp:

    Created USD_WebServiceSoap object usd

    Error Message: exception decrypting data - java.lang.NullPointerException

    Additional Details: org.bouncycastle.jcajce.provider.ProvIOException: exception decrypting data - java.lang.NullPointerException



  • 2.  Re: Implement loginServiceManaged challenge

    Posted Mar 07, 2018 08:33 PM

    This is the line in the jsp where it is failing:

        ks.load( new FileInputStream( dir + "/" + accessPolicy + ".p12" ), privateKeyPassword);



  • 3.  Re: Implement loginServiceManaged challenge

    Posted Mar 12, 2018 07:18 PM

    Any ideas out there why the pkilogin.jsp is successful on the first try but fails on subsequent tries? Recycling Tomcat clears the issue (but for one time only). There is not problem with r14.1. Could the fact that r17.1 comes with Java 8 have something to do with it?



  • 4.  Re: Implement loginServiceManaged challenge

    Posted Mar 08, 2018 05:06 AM

    Due to the r17.1 change in implementation of the WebServices, the .jsp is no longer accurate.

    Replace - in the .jsp file - the lines:

     

    <%@ page import="usdjws65.ArrayOfString" %>
    <%@ page import="usdjws65.USD_WebServiceLocator" %>
    <%@ page import="usdjws65.USD_WebServiceSoap" %>

    with:

    <%@ page import="usdjws65.ArrayOfString" %>
    <%@ page import="usdjws65.USD_WebServiceLocator" %>
    <%@ page import="usdjws65.USD_WebServiceSoap" %>

    and then try again to run the sample.



  • 5.  Re: Implement loginServiceManaged challenge

    Posted Mar 08, 2018 10:16 AM

    Hi Cristi,

    Did you mean to replace these lines?

     

    <%@ page import="com.ca.www.UnicenterServicePlus.ServiceDesk.ArrayOfString" %>
    <%@ page import="com.ca.www.UnicenterServicePlus.ServiceDesk.USD_WebServiceLocator" %>
    <%@ page import="com.ca.www.UnicenterServicePlus.ServiceDesk.USD_WebServiceSoap" %>

    Cheers,

    Lindsay



  • 6.  Re: Implement loginServiceManaged challenge

    Posted Mar 08, 2018 10:52 AM

    Thanks Cristi, that worked.



  • 7.  Re: Implement loginServiceManaged challenge

    Posted Mar 08, 2018 11:28 AM

    Well, I spoke too soon. I had restarted the Service Desk and the pkilogin.jsp worked the first time but when I run it again it fails with "Error Message: exception decrypting data - java.lang.NullPointerException".

     

    I just verified that if I restart Tomcat on the server it works for the first time but not subsequent times. No problem however on an r14.1 implementation.



  • 8.  Re: Implement loginServiceManaged challenge

    Broadcom Employee
    Posted Mar 16, 2018 08:35 AM

    Lindsay,

     

    Can you confirm the size of your DEFAULT.p12 file,  is it 2k or 3k?

     

    Thx

    _R



  • 9.  Re: Implement loginServiceManaged challenge

    Posted Mar 16, 2018 11:29 AM

    Hi Raghu,

    It is 3K (2,440 bytes to be exact).

    Cheers,

    Lindsay



  • 10.  Re: Implement loginServiceManaged challenge

    Broadcom Employee
    Posted Mar 16, 2018 12:43 PM

    Thank you. That's the valid one.

     

    Was your wsdl generation successful?  I'm seeing a difference in the class structure between 17.0 and 17.1 stubs.

     

    However that does not explain why it works for you first time and does not there after later.

     

    _R



  • 11.  Re: Implement loginServiceManaged challenge
    Best Answer

    Broadcom Employee
    Posted Mar 16, 2018 03:45 PM

    Actually don't worry about my question above.

     

    I'm seeing the same behavior.  Let me dig in a bit, almost feels like we have a defect that needs to be addressed.  You could raise up a support case and hit me up.

     

    Thx

    _R