To obtain an access token, make a POST request to the token endpoint with your client credentials.
Your client_id and client_secret provide access to all your data, so keep them secure. Do not share them publicly by checking them into GitHub or client side code.
Access tokens issued through the client credentials flow have a limited lifetime. The lifetime is per client credential and set according to the security policy of the client. The client credentials grant does not support refresh tokens by design. The client can use its credentials (client_id and client_secret) to obtain a new access token.
When your access token expires, simply make a new request to the token endpoint using the same client credentials
Consider implementing automatic token renewal in your application by
monitoring the expires_in value and requesting a new token before the
current one expires if you need longer sessions for machine-to-machine
authentication.
For applications that need to authenticate end users (not just machine-to-machine communication), Intermezzo provides several OAuth 2.0 flows designed for different application types and security requirements.
For Single-Page Applications (SPAs) and mobile applications that cannot securely store client secrets, use the Authorization Code Flow with Proof Key for Code Exchange (PKCE).
Copy
Ask AI
# Generate code_verifier (43-128 character random string)code_verifier="dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"# Create code_challenge (SHA256 hash of verifier, base64url encoded)code_challenge="E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM"
Refresh tokens are sensitive credentials. Store them securely and never expose
them in client-side code or logs. For SPAs, consider using secure storage
mechanisms or implementing refresh token rotation.
Access Token: Used to authenticate API requests. Include in the Authorization header for protected endpoints.ID Token: Contains user identity information. Used by the client application to establish user sessions and display user profile data.Refresh Token: Long-lived credential used to obtain new access tokens. Only available when offline_access scope is requested.