Authenticate with a service account
Use Basic or Bearer authentication when accessing APIs with a service account
Read time 1 minuteLast updated a day ago
You can use either Basic or Bearer authentication to access Unity service API endpoints with a service account. In both cases, use a key ID as the client name and the matching secret as the client secret. Don't use the service account name or its UUID to authenticate. All keys that belong to the same service account are interchangeable and resolve to the same service account. Read more about managing keys for a service account.
Bearer token authentication
To use Bearer authentication, first obtain a JWT token for the service account, and then pass it in theAuthorizationReplacehttps://<SolutionFQDN>/auth/realms/unity/protocol/openid-connect/token
<SolutionFQDN>Example
The following sample request uses cURL to obtain a JWT token:Replace thecurl --request POST \--url 'https://<SolutionFQDN>/auth/realms/unity/protocol/openid-connect/token' \--header 'content-type: application/x-www-form-urlencoded' \--data grant_type=client_credentials \--data client_id=<KeyId> \--data client_secret=<Secret>
KeyIdSecret