Tokens from both methods expire after 30 minutes.
Access control for user tokens
A user token carries the permissions of the user who requested it. The API enforces the same roles that apply in the dashboard: organization roles, team roles, and product and ruleset roles, whether assigned directly, through a team, or at the organization level. When a user token lacks the permission for a request:- List endpoints, such as listing products, return only the resources the user can access.
- A
GETrequest for a single resource the user can’t access returns404 Not Found, as if the resource didn’t exist. - Other requests, such as uploading an image or starting a scan, return
403 Forbiddenwith the permission that was missing.
Access control for M2M tokens
This applies to every M2M client, including clients created on-premises in Keycloak. Roles or scopes assigned to the client’s service account in Keycloak don’t limit what the client can do in BTP. Until scoped M2M access is available, treat a client secret like an Organization Admin password:- Store the client ID and secret in your CI/CD platform’s secret store, never in source code or build logs.
- Limit who can read the secret and who can edit pipelines that use it.
- Create a separate API client for each pipeline or system, so you can revoke one without affecting the others.
- Rotate the client secret regularly, and immediately if you suspect it was exposed.
- If a workflow needs access limited to specific products, use user authentication with a dedicated BTP user that has only the roles the workflow needs.