Authentication overview
Every call to the CyberSentriq API carries an OAuth 2.0 access token in an Authorization: Bearer header. This guide covers how to get a token, the values you need to request one, and how the API checks it.
Getting a token
Your integration authenticates as an API client with the client-credentials grant. See Authenticating as an API client, which also shows how to create your first API client from the API reference.
What you need to get a token
Your client exchanges its credentials for an access token at the token endpoint. These are the values it needs, and they are the same for every token:
| Value | What to send |
|---|---|
| Token endpoint | https://auth.cybersentriq.com/oauth/token |
| Audience | https://api.cybersentriq.com |
| Scopes | api:full:read and api:full:write, see Access scopes |
The token you get back lasts one hour and comes with no refresh token: request another one before it expires. See Authenticating as an API client for the request in every language.
How you send it
Every API call carries the token in an Authorization: Bearer <ACCESS_TOKEN> header, to the base URL https://api.cybersentriq.com. The audience you requested the token for is that same base URL: a token is only ever accepted by the API it was issued for.
Each call also takes an apiVersion query parameter; that is about the API, not the token, and Endpoints and versioning covers it.
How a token is checked
Before it handles a call, the API checks that the token's signature is valid, that it was issued by the CyberSentriq identity service, that its audience is this API, and that it has not expired. A token that fails any of these is refused with 401. Get a new token and retry once. You do not need to repeat these checks yourself.
Treat the token as opaque
Send the token as you received it, and do not read anything out of it. Its contents are not part of the API contract and can change without notice. What a caller may do is decided by the API when it handles each request, from the API client's role and the organization it belongs to. Request the access scopes your integration needs and let the API make the decision.
Next
- Get a token for a service: Authenticating as an API client.
- Put it together: Building an end-to-end integration.