Skip to content
Skills Intelligence
Authentication
latest

Authentication🔗

The APIs use OAuth 2.0 Client Credentials Grant flow for authentication and authorization.

Use the following request to obtain an authentication token:

CLIENT_ID={Client id obtained from Textkernel}
CLIENT_SECRET={Client secret obtained from Textkernel}
HOST_URL={idp.textkernel.nl or idp.textkernel.com}

# Authentication token
TOKEN=$(
curl -X POST \
        --header "Content-Type: application/x-www-form-urlencoded" \
        --data grant_type="client_credentials" \
        --data client_id=${CLIENT_ID} \
        --data client_secret=${CLIENT_SECRET} \
        https://${HOST_URL}/auth/realms/api/protocol/openid-connect/token \
        | jq -r .access_token
)

You need to send your authentication token with each request:

curl -H "Authorization: Bearer $TOKEN" {request}

The token's expiry time is 15 minutes.