authentication-services-colmena
๐ How to Get a New Token
To authenticate and consume the organizationโs services, you must first obtain an access token by making a POST
request to the /token
endpoint of the authentication-api.
๐ค Request
Method: POST
Endpoint: /token
Content-Type: application/json
Headers:
Header | Type | Required | Description | Example |
---|---|---|---|---|
client_id | String | Yes | Client ID provided to you | 123456 |
client_secret | String | Yes | Secret associated with the client ID | 123456 |
grant_type | String | No | Grant type, use CLIENT_CREDENTIALS | CLIENT_CREDENTIALS |
๐ก This endpoint does not require a request body. Only headers are required.
โ Successful Response
Status Code: 200 OK
Content-Type: application/json
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}
Field | Type | Description |
---|---|---|
access_token | String | JWT token used to authenticate future requests |
token_type | String | Token type, typically Bearer |
expires_in | Number | Time in seconds until the token expires |
๐ Error Responses
Example - Missing or invalid credentials:
Status Code: 401 Unauthorized
{
"error": "invalid_client",
"error_description": "Client authentication failed"
}
Status Code: 400 Bad Request
{
"error": "unsupported_grant_type",
"error_description": "The authorization grant type is not supported"
}
๐ Related Endpoints
- POST /validateToken โ To validate an existing token.
ยฟQuieres que lo adapte tambiรฉn a espaรฑol o necesitas el mismo formato para otros endpoints?