Skip to content
Workforce IdentityMarkdown

Register an app

Add an app, an API client or a service to your realm, choose how it signs in and what it may ask for, and change or turn it off later.

AvailableAPIRFC 6749, RFC 7591

Every app that signs users in through your realm, and every service that gets tokens from it, is registered as a client. The registration says how the app proves who it is, which grants it uses, where the browser may return to, and the most it may ask for. The app then points any OAuth 2.0 or OpenID Connect library at the realm’s issuer, https://foobar.cvyuh.com/oauth2, with its client ID.

  • Who can do it: a realm administrator (a group holding RealmOwner); RealmViewer can see the realm’s apps but not change them.
  • Where: today this is done through the API (Call the API shows how to get $CVYUH_SESSION).
  • First: know the app’s kind (below), its redirect addresses, and the API it will call.

A client is an oauth2Client object in the realm, and its object id is its client_id. Four choices shape it:

ChoiceFieldWhat it decides
How it proves who it istokenEndpointAuthMethodA secret, a signed key assertion, a TLS certificate, an attestation, or nothing for an app that can’t keep a secret
How it gets tokensgrantTypesA browser sign-in, its own credentials, a device code, a token exchange, and the rest
Where users returnredirectUris, postLogoutRedirectUrisThe exact addresses the browser may come back to after sign-in and sign-out
The most it may havescopes, allowedResourcesThe scopes it may be granted and the APIs it may get tokens for

A client’s lists take effect only where they meet the realm’s: a grant the realm doesn’t accept, or a scope the realm doesn’t offer, is refused even when the client names it. The realm’s own lists are in Realm OAuth settings.

The apptokenEndpointAuthMethodgrantTypesGuide
A web app with a serverclient_secret_basic or private_key_jwtauthorization_code, refresh_tokenSign users in to a web app
A single-page appnoneauthorization_code, refresh_tokenSign users in to a single-page app
A mobile or desktop appnoneauthorization_code, refresh_tokenSign users in to your own native app
A TV or command-line toolnoneurn:ietf:params:oauth:grant-type:device_codeSign in a TV or command-line tool
A service calling an APIclient_secret_basic or private_key_jwtclient_credentialsLet one service call another
An AI agentprivate_key_jwtclient_credentialsRegister an agent

A client with none is public: it has no secret, so it signs users in but never gets a token on its own credentials. Client credentials, token exchange and identity assertions are refused to it. Choose how a client proves itself compares the methods.

Call the API shows how to get a session for these calls.

  1. Make sure the realm offers the app’s scopes. It offers openid, profile, email and offline_access from the start. To add your API’s scopes, read the realm’s list, then send it back with yours added; the list you send replaces the realm’s:

    Terminal window
    curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Settings/oauth2Settings \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{ "scopes": ["…existing scopes", "app:read", "app:write"] }'
  2. Register the app. The id you choose is its client ID:

    Terminal window
    curl 'https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client?id=example-app' \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{
    "status": "active",
    "clientName": "Example App",
    "tokenEndpointAuthMethod": "client_secret_basic",
    "clientSecret": "<a long random secret>",
    "grantTypes": ["authorization_code", "refresh_token"],
    "redirectUris": ["https://app.example.com/callback"],
    "postLogoutRedirectUris": ["https://app.example.com/"],
    "scopes": ["openid", "profile", "email", "offline_access", "app:read"],
    "defaultScopes": ["openid"],
    "allowedResources": ["https://app.example.com/api"],
    "defaultAudience": "https://app.example.com/api"
    }'

    The realm answers 201. clientName is what the consent page shows users.

  3. Give the app its settings: the client ID example-app, its secret, and the issuer https://foobar.cvyuh.com/oauth2. Most libraries read every endpoint from the Discovery document. The secret is stored hashed and never shown again, so keep a copy for the app.

ToCall
List the realm’s appsGET https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client
Read oneGET https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/example-app
Change itPATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/example-app with the fields to change
Turn it offThe same PATCH, with { "status": "inactive" }
Remove itDELETE https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/example-app

For example, to turn the app off:

Terminal window
curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/example-app \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
-H "Content-Type: application/json" \
-d '{ "status": "inactive" }'

An inactive app is answered exactly as one that doesn’t exist: it can’t sign anyone in, and its refresh tokens are refused. Set status back to active to restore it.

To replace a secret, send a new clientSecret; Client authentication explains how the old one can keep working for a while so the app can move.

  • A list you send replaces the whole list. To add one redirect address, read the client’s redirectUris, add yours, and send them all back. The same goes for scopes, grants and origins.
  • Redirect addresses match exactly. Each is https, a loopback address over http (http://127.0.0.1 or http://[::1], whose port may differ), or a private-use scheme in reverse-domain form such as com.example.app:/callback. None may carry a fragment.
  • Every token names one API. A request that names no resource gets defaultAudience, which must be one of allowedResources. With no default, such a request is refused. See Resource indicators.
  • Pages may call the token endpoint from the app’s own sites. webOrigins starts as ["+"], the origins of the app’s redirect addresses. See Browser apps.
  • A client ID can’t be a UUID. Choose a readable name such as example-app; an ID shaped like a UUID never signs in.
  • Developers can register their own apps with a token you hand out: see Dynamic registration.
Setting or limitDefaultRange
Clients in a realm1,000those you register and those developers register together; past it, a new client is refused. Ask support to raise it
statusactiveactive or inactive
grantTypes["client_credentials"]within the realm’s grantTypes
webOrigins["+"], the origins of the redirect addressesexact origins
refreshTokenRotationreuse; always rotate for a public clientrotate or reuse
clientSecretExpiresAtnone, the secret doesn’t expireany time
SymptomCauseFix
The realm shows an error page, not the sign-in: “the redirect_uri is missing or is not one the client registered”The app sent an address that isn’t exactly one of redirectUrisAdd the exact address, scheme, host, port and path, to redirectUris
invalid_scope for a scope you added to the clientThe realm’s scopes doesn’t offer itAdd it to the realm’s list, keeping the existing values
invalid_target, or a token request refused for naming no APINo resource was sent and the client has no defaultAudienceSet defaultAudience to one of allowedResources
invalid_client for an app that workedIt was turned inactive, its secret expired or was replacedCheck status and clientSecretExpiresAt; send the app its new secret
Registering a client is refusedThe realm holds its most clientsRemove clients no longer used, or ask support to raise the limit

Registering, changing or removing an app is a change to an oauth2Client object: a CREATED, PATCHED, UPDATED or DELETED record with what changed, before and after, secrets left out. See it in Audit → Config, or in Change history. Each token the app gets is a TOKEN_ISSUED record.

FieldWhat it does
status (active)active or inactive. Only an active client signs in
clientNameThe name consent shows users
tokenEndpointAuthMethod (required)none, client_secret_basic, client_secret_post, private_key_jwt, self_signed_tls_client_auth or attest_jwt_client_auth; any other method is refused
clientSecretThe secret, for the two secret methods. Stored hashed, never readable
clientSecretExpiresAtWhen the secret stops working; absent, it doesn’t expire
jwks, jwksUriThe client’s public keys, inline or at an https address, for private_key_jwt, signed requests and certificates
tokenEndpointAuthSigningAlgPins the algorithm its assertions are signed with
grantTypes (["client_credentials"])The grants it may use, within the realm’s
scopes, defaultScopesThe most it may be granted, and what it gets when it asks for none
allowedResources, defaultAudienceThe APIs it may get tokens for, and the one used when it names none
servesResourcesThe APIs this client is, so it may introspect their tokens and exchange them
redirectUris, postLogoutRedirectUrisWhere the browser may return after sign-in and sign-out
webOrigins (["+"])The sites a page may call the token, revocation, pushed-request and userinfo endpoints from
backchannelLogoutUriWhere the app is told a session it signed in through has ended
consentImpliedSkip the consent page for this app, where the realm allows it
firstPartyThe realm’s own app, which may sign users in with its own screens
refreshTokenRotationrotate or reuse (the default); a public client’s always rotate
scopeClaimsPer scope, the user details this app gets in place of the realm’s
idTokenSignedResponseAlg, userinfoSignedResponseAlg, introspectionSignedResponseAlgHow its ID tokens, userinfo answers and introspection answers are signed
requirePushedAuthorizationRequestsTake its sign-in requests only as pushed ones
requestObjectSigningAlg, requestObjectEncryptionAlg, requestObjectEncryptionEncHow it signs, and may encrypt, its sign-in requests
dpopBoundAccessTokensIssue it only tokens bound to its DPoP key
tlsClientCertificateBoundAccessTokensBind its tokens to its TLS certificate
securityProfilenone, oauth2.1 or fapi2
statusListedGive its tokens a status list entry, for APIs that check tokens offline
authorizationDetailsTypesThe structured permission types it may ask for
exchangesAudienceLet it exchange a token it sees for one meant for another API
issuesTxnTokensLet it ask for transaction tokens
agent, assertionTrust, spiffeId, clientAttestersThe agent it signs in as, and where its credentials are trusted from
backchannelTokenDeliveryMode, backchannelClientNotificationEndpoint, deferredClientNotificationEndpointHow an agent learns its owner answered an approval request

Values in brackets are the defaults. Each field’s own page is linked from Applications.