I want to List the Black duck scan versions and I found API in blackduck API section and appended some headers as below.
curl -X GET -H "Authorization: Bearer ${TOKEN}" https://<URL>/api/projects/${project_id}/versions
SSL certificate problem: unable to get local issuer certificate
After running above command I am getting above error. Is the API_TOKEN enough for authentication right or am i missing something here
The user token is not enough for authentication, follow steps below.
Note that the bearer token has a timeout and should be updated !
Make a request that uses the user.
response=$(curl --insecure -X POST --header "Content-Type:application/json" --header "Authorization: ${TOKEN}" https://<URL>/api/tokens/authenticate)
Extract Bearer Token
bearer_token=$(echo "${response}" | jq --raw-output '.bearerToken')
Use the bearer token to make API calls
curl --insecure -X GET --header "Content-Type:application/json" --header "Authorization: bearer $bearer_token" https://<URL>/api/projects/${project_id}/versions