API Enablement

  • 1.  Should "try me" work?

    IBM Champion
    Posted Sun September 27, 2020 12:03 PM
    I have problems with opening an API with "Open in Swagger".
    9 times out of 10 it does not open - I just get a blank screen.

    For the odd occasion when I do get up a page, I can click on the page etc.  But the try me does not work.
    It has displayed a curl expression.  Is this the actual command used?
    If I click "try me " it is not successful.
    Because I have security enabled, and client must present a certificate  etc, I dont see how the curl expression will work - it will need me to specify the keystore and trust store - for curl.

    I have already configured eclipse to have a keystore etc.(see here) I think that the names of the keystore and trust store need to be extracted from eclipse - and plugged into the curl command

    I found "Note: The embedded Swagger UI supports only basic authentication. Client authentication is not "supported" .  It would be good if the panel provided a pop up saying "not  supported withClient certificate authentication" rather than display nothing.

    regards

    Colin


  • 2.  RE: Should "try me" work?

    Posted Mon September 28, 2020 08:27 PM

    Hi Colin,
    The curl command shown by Swagger UI is informational only as curl is not used.  JS/HTML code cannot ask the browser whether client-cert is in effect, so we cannot modify Swagger UI to inform the user either way.  As you've discovered, there is no relationship between the Java/JVM defined security in Eclipse, and an internal or external Web browser.   Java/JVM/Eclipse and JS/HTML are truly disjoint from a security perspective.  If you want to use Swagger UI with client-cert you can configure Eclipse to always launch Swagger UI in your external browser by going to Window>Preferences>General>Web Browser in Eclipse and selecting "Use external browser".  You will need to configure the external browser with the client certificate before launching it.  With regard to Swagger UI not opening in the internal browser, please check that packages libwebkitgtk-1.0-0 and libwebkitgtk-3.0-0 are installed if you're running on Ubuntu...

    sudo apt-get install libwebkitgtk-1.0-0
    sudo apt-get install libwebkitgtk-3.0-0

    --Ted



    ------------------------------
    Ted Cipresso
    ------------------------------