Skip to content
Application identity

Application authentication

Register software as an Application and choose how it proves its identity to Keycard.

An Application is the identity Keycard gives to a piece of software: an MCP server, an agent, a web app, a CLI, or a background job. Keycard issues tokens to Applications, and every token it issues names the Application in its keycard_app_id claim. Before software can request tokens from your Zone, register it as an Application and give the Application a credential.

An Application has a name, shown to users on consent screens, and an identifier, unique in the Zone, such as support-agent or a URL. An Application that signs users in also needs redirect URLs: the URLs Keycard may send authorization codes to.

In Keycard Console, go to Applications → Add Application, set Name, Identifier, and any Redirect URLs, then click Create application.

A credential is how an Application proves its identity at the Zone’s token endpoint, /oauth/2/token. An Application can hold several, for example a client secret for local development and a Workload Identity credential for production. Each request authenticates with one.

Credential type The Application sends Use for
Workload Identity Recommended token A token its platform issues, plus the credential’s Client ID Workloads on a cloud, CI, or Kubernetes platform
Public key public-key A JWT signed with its private key Software that holds a key pair and serves its public keys
URL url A JWT signed with its private key, or only its client ID if it’s a public Application Software identified by a URL it controls
Client ID & Secret Shared secret password A client ID and a shared secret Local development, and hosts with no other option
Public public Only a client ID Browser and native apps that sign users in

Add a credential in Keycard Console, with the Keycard Terraform provider, or with the management API.

The Application sends its client ID and secret to the token endpoint, as KEYCARD_CLIENT_ID and KEYCARD_CLIENT_SECRET in the SDKs. Keycard returns the secret only once, so store it right away.

On the Application’s Application Credentials tab, click Add credential and choose Client ID & Secret. Copy the client ID and secret.

The Application’s platform issues it a short-lived token. The Application sends that token as client_assertion, and the credential ID as client_id. Keycard verifies the token against a Provider registered for the platform’s issuer, then checks its audience, subject, and claims. No secret is stored.

On the Application’s Application Credentials tab, click Add credential and choose Workload Identity:

Field Value
Provider The Provider for the platform’s issuer
Subject The sub the platform puts in the workload’s token
Allowed audience Optional. The token’s aud must be exactly this one value. Defaults to the Zone issuer URL.
Authentication condition Optional. A CEL expression over the token’s claims that must evaluate to true.

Set Subject, Authentication condition, or both.

Copy the credential’s Client ID from the Application Credentials tab. The workload sends it as client_id.

The Application signs a JWT with its private key and sends it as client_assertion, the private_key_jwt method from RFC 7523. Keycard verifies the signature against the public keys at the credential’s JWKS URL. To rotate keys, publish the new key there before signing with it.

On the Application’s Application Credentials tab, click Add credential and choose Public Key:

Field Value
Client ID The client ID the Application sends
JWKS URL The URL that serves the Application’s public keys

The Application’s client ID is a URL that serves an OAuth Client ID Metadata Document. Keycard fetches the document from the URL to learn how the Application authenticates and which grants it uses, listed in grant_types. The URL must be reachable from the public internet.

  • A confidential Application signs a JWT with its private key. Its document sets token_endpoint_auth_method to private_key_jwt, names the signing algorithm, and points to its public keys with jwks_uri.
  • A public Application, such as a CLI or a native app, has no key. It signs Users in with the authorization code or device code flow.

Give an agent its own access builds a confidential Application this way.

On the Application’s Application Credentials tab, click Add credential, choose URL, and enter the client metadata document’s URL.

A browser or native app can’t keep a secret, so it sends only its client ID. PKCE is required, and protects the authorization code exchange. A public credential works only for flows where a User delegates access. It can’t get tokens for the Application acting as itself.

On the Application’s Application Credentials tab, click Add credential, choose Public, and enter the Identifier the app sends as its client ID.