Clients

A client represents an application that uses FerrisKey for authentication. Every OAuth2/OIDC flow starts with a client — it identifies which application is requesting access and determines what authentication methods and token configurations apply.

Client Types

FerrisKey supports three client types:

TypeSecretUse Case
ConfidentialYesServer-side applications that can securely store a client secret
PublicNoSingle-page applications (SPAs), mobile apps, or CLI tools
SystemInternal FerrisKey clients (auto-created, not user-managed)

Choosing a client type

Use Confidential when your application has a backend that can keep the client secret safe. Use Public for browser-based or mobile applications where the secret would be exposed to the user.

Client Properties

PropertyDescription
client_idPublic identifier used in OAuth2 flows
secretClient secret (confidential clients only)
protocolProtocol type (e.g., openid-connect)
enabledWhether the client can initiate authentication
redirect_urisAllowed redirect URIs after authentication
direct_access_grants_enabledAllow the password grant type
service_account_enabledEnable client credentials grant

Token Lifetime Overrides

By default, clients inherit token lifetimes from their realm. You can override these per-client for fine-grained control:

OverrideDescription
access_token_lifetimeAccess token TTL in seconds
refresh_token_lifetimeRefresh token TTL in seconds
id_token_lifetimeID token TTL in seconds
temporary_token_lifetimeTemporary token TTL in seconds

When set, the client’s value takes precedence over the realm default. When null, the realm default applies.

Direct Access Grants

When enabled, a client can use the Resource Owner Password Credentials grant — sending username and password directly to the token endpoint. This is useful for trusted first-party applications and testing, but should not be used for third-party clients.

Service Accounts

A client with service_account_enabled can authenticate using the Client Credentials grant — no user involved. FerrisKey creates a linked service account user for the client, which can be assigned roles and permissions just like a regular user.

This is the standard pattern for machine-to-machine communication.