IBM Security Guardium

 View Only
  • 1.  Error on getting access token for REST API

    Posted Mon March 13, 2023 09:48 AM
      |   view attached

    Hi everyone,

    I'm experiencing some problems in receiving the access token for the use of REST APIs. 

    I followed this guide Using Guardium REST APIs - IBM Documentation but at the second step, when I should receive the access token, after the curl, I get an error which says  "There has been an Error. Please Contact your System Administrator".

    I see the same error if, from the GUI of the Guardium machine, I try to go to /oauth/token (which is the page from which Guardium gives me the token, according to the guide linked above), so what comes in my mind is that some configuration is missing but I don't find what's missing.

    Thanks in advance



    ------------------------------
    Francesco
    ------------------------------


  • 2.  RE: Error on getting access token for REST API

    Posted Tue March 14, 2023 09:53 AM

    Hi Francesco,

    here is what I tested and it worked for me last week:

    Step 1: register oauth client using Guardium CLI

    > grdapi register_oauth_client client_id=<id for your client> grant_types="password" scope="read"

    {"client_id":"<id for your client>","client_secret":"<client secrete provided by grdapi>","grant_types":"password","scope":"read","redirect_uri":"https://someApp"}

    <id for your client> - provide ID for client you will call REST API from. Make a note of it and <client secret provided by grdapi> you get as a response

    Step 2: retrieve oath token for making REST API calls

    curl --location --request POST 'https://<Guardium host/port>/oauth/token?client_id=<id for your client>&client_secret=<client secret provided by grdapi>&grant_type=password&username=<valid Guardium user>&password=<user password>

    Params:

    • <id for your client>, <client secret provided by grdapi> provide values from Step 1.
    • <valid Guardium user>, <user password> these should be credentials of a valid Guardium Collector/Central Manager user.
    • <Guardium host/port> - host/port of your Guardium Collector/Central Manager

    Hope this helps,

    Maksym



    ------------------------------
    Maksym Tykhenko
    ------------------------------



  • 3.  RE: Error on getting access token for REST API

    Posted Wed March 15, 2023 09:58 AM

    Hi Maksym,

    thanks for the response. I tried with your syntax but with single quote curl says: curl: (3) URL using bad/illegal format or missing URL

    I tried to replace single quote with double quotes and I get another error which is related to certificate chain

    Thanks

    Francesco



    ------------------------------
    Francesco Cappellozza
    ------------------------------



  • 4.  RE: Error on getting access token for REST API

    Posted Wed March 15, 2023 10:53 AM

    Hi Francesco,

    in order to deal with self-signed ssl certificate warnings/issues, please try checking this or similar guide https://www.cyberciti.biz/faq/how-to-curl-ignore-ssl-certificate-warnings-command-option/

    I shared examples in curl format but you are free to use tools like Postman/Insonmia to test REST API. Those tools have settings to ignore ssl certificates warnings.

    Maksym 



    ------------------------------
    Maksym Tykhenko
    ------------------------------



  • 5.  RE: Error on getting access token for REST API

    Posted Wed March 15, 2023 11:28 AM

    Thanks for the help Maksym, I'll try to solve the issue with your suggestions.

    Thanks

    Francesco



    ------------------------------
    Francesco Cappellozza
    ------------------------------