Overview
Clients represent applications that can authenticate users within a realm. Each client receives a unique client_id and client_secret which must be provided during the login flow. This ensures only authorized applications can request tokens.
Request Body
The realm identifier where this client will be registered.
Array of allowed redirect URIs for OAuth flows. Used for security validation in authorization code flows.
Response
Returns the created client with generated credentials:
Auto-generated UUID serving as the client identifier.
Auto-generated UUID serving as the client secret. Store this securely.
The realm this client belongs to.
Array of allowed redirect URIs.
Example
curl -X POST http://localhost:8080/v1/auth/clients \
-H 'Content-Type: application/json' \
-d '{
"realm_id": "acme",
"redirect_uris": [
"https://app.acme.com/callback",
"http://localhost:3000/callback"
]
}'
{
"client_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"client_secret": "a1b2c3d4-e5f6-4a5b-8c7d-9e8f7a6b5c4d",
"realm_id": "acme",
"redirect_uris": [
"https://app.acme.com/callback",
"http://localhost:3000/callback"
]
}
Security Notes
The client_secret is only returned once during creation. Store it securely in your application’s configuration. If lost, you must create a new client.
- Use the
client_id and client_secret in all token requests for this realm
- Redirect URIs provide security validation for OAuth flows
- Each client is scoped to a single realm
Error Responses
Human-readable error message when the request fails.
Common errors:
- 400 Bad Request: Invalid request format or missing required fields
- 404 Not Found: Realm does not exist
- 500 Internal Server Error: Client creation failed due to internal error