Thanks for the help Maksym, I'll try to solve the issue with your suggestions.
Original Message:
Sent: Wed March 15, 2023 10:53 AM
From: Maksym Tykhenko
Subject: Error on getting access token for REST API
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
Original Message:
Sent: Wed March 15, 2023 09:57 AM
From: Francesco Cappellozza
Subject: Error on getting access token for REST API
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
Original Message:
Sent: Tue March 14, 2023 09:32 AM
From: Maksym Tykhenko
Subject: Error on getting access token for REST API
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
Original Message:
Sent: Mon March 13, 2023 04:23 AM
From: Francesco Cappellozza
Subject: Error on getting access token for REST API
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
------------------------------