Prerequisites
Before you start, make sure you have:- A Prelude account with access to Prelude Auth
- An Application ID (
appID): see Applications - Your Management API key for backend calls
How it works
The client credentials flow allows your backend application to:- Register an OAuth client (a “service account”) with Prelude Auth
- Exchange the client credentials (ID and secret) for an access token
- Use the token to authenticate requests to your backend or other services
- Service-to-service communication
- Scheduled jobs and background tasks
- Microservices that need to call each other
- API integrations that don’t involve a user
Set up server tokens
1
Register an OAuth client
Create a new OAuth client registered for the The response includes your
client_credentials grant type:client_id and client_secret. Store the secret securely, you’ll need it to request tokens. The secret is only returned once, if you lose it, you’ll need to rotate the client.2
Request an access token
Exchange your client credentials for an access token:Alternatively, use HTTP Basic authentication:The response contains:
Note: Client credentials tokens do not include a
refresh_token. When the token expires, request a new one.3
Use the access token
Include the token in the On your backend, verify the token signature using the JWKS endpoint. The token’s subject (
Authorization header of your requests:sub claim) will be the client ID.Token claims
Tokens issued via client credentials include the following claims:subis the client ID (not a user ID)session_idis absent. There is no session- Tokens are not revocable via session invalidation
- Tokens expire after 1 hour (configurable)
Client rotation
If you suspect your client secret has been compromised:- Create a new client with the same scopes and grant types
- Update your application to use the new credentials
- Delete the compromised client using the Management API
What’s next?
- Review the token verification guide to validate tokens on your backend
- Set up webhooks if you need to be notified of token-related events
- Explore the Management API for advanced token management