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