Skip to main content

Authentication

API Credentials

To access CELITECH services, you must authenticate using API credentials. These credentials consist of:

  • Client ID – A unique identifier for your application.
  • Client Secret – A confidential key used to authenticate your application.

You can find these credentials in your CELITECH Dashboard. Keep them safe and never expose them in client-side code or public repositories.

API Credentials

Generating an Access Token

CELITECH uses OAuth 2.0 Client Credentials Flow for server-to-server authentication.

To generate an access token, make a POST request to the token endpoint with your client_id and client_secret.

Endpoint

POST https://auth.celitech.net/oauth2/token

Request Headers

Content-Type: application/x-www-form-urlencoded
Authorization: Basic BASE64(client_id:client_secret)

The Authorization header should contain a Base64-encoded string of your client_id and client_secret joined by a colon (:).
Example: Authorization: Basic base64(client_id:client_secret)

Request Body

grant_type=client_credentials

Response Body

If the credentials are valid, the server responds with a JSON object containing the access token and its expiration.

{
"access_token": "YOUR_ACCESS_TOKEN",
"expires_in": 3600,
"token_type": "Bearer"
}
  • access_token: The token to include in your requests.
  • expires_in: Time in seconds before the token expires (typically 3600 seconds).
  • token_type: Always "Bearer".

Token Expiration and Caching

To optimize performance and reduce the number of requests to the token endpoint, the access tokens can be optionally cached for 1 hour (3600 seconds).

Refreshing the Token

There is no refresh token. When the access token expires, generate a new one using the same client credentials and token endpoint.

Security Best Practices

  • Never expose your client_id or client_secret in frontend or public code.
  • Store credentials and tokens securely on the server using environment variables or a secrets management tool (e.g AWS Secrets Manager).

Need Help?

If you encounter issues or need assistance, please contact support.