Skip to main content
To interact with the Binarly Transparency Platform API, you need to authenticate by obtaining an authentication token. This guide provides step-by-step instructions on how to acquire the token and use it to upload an image for scanning.

Prerequisites

Before you begin, ensure you have the following information provided by Binarly Customer Support:
  • APP_NAME: The name of your API client.
  • APP_SECRET: The secret key for your API client.
  • OIDC_URL: The URL of the OpenID Connect server, typically https://auth.<ID>.binarly.cloud/realms/BinarlyRealm/protocol/openid-connect/token.

Run the following commands to get your authentication token:

TOKENJSON=$(curl --fail-with-body \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "grant_type=client_credentials" \
  --data-urlencode "client_id=${APP_NAME}" \
  --data-urlencode "client_secret=${APP_SECRET}" \
  --data-urlencode "audience=main-api" \
  ${OIDC_URL})

TOKEN=$(jq -r '.access_token' <<< $TOKENJSON)

echo $TOKEN