Security profiles
One client setting holds a client to a named set of rules, OAuth 2.1 or the stricter FAPI 2.0 for high-value data.
AvailableAPIOAuth 2.1, FAPI 2.0 Security Profile
Instead of setting a dozen options one by one, you name a profile for the client. The realm refuses a registration that can never meet it, and holds the client to it on every request.
Choose fapi2 for clients handling money, health records or anything regulated, and wherever an ecosystem asks for
FAPI 2.0. Choose oauth2.1 when you want the client’s registration to say what it relies on. An
agent’s client is fapi2 unless you name another profile.
Before you begin
Section titled “Before you begin”- Who can do it: a realm administrator (a group holding
RealmOwner);RealmViewercan read a client’s profile but not change it. - Where: today this is done through the API (Call the API shows how to get
$CVYUH_SESSION). - First: for
fapi2, the client holds a P-256 key forprivate_key_jwtand can sign DPoP proofs.
How it works
Section titled “How it works”| Profile | What it holds the client to |
|---|---|
none (default for a user’s app) | The realm’s own rules, which already meet OAuth 2.1 |
oauth2.1 | The same. The realm already requires PKCE, exact return addresses and rotation for public apps, and has no implicit or password grant. Choose it to state that you rely on that |
fapi2 (default for an agent’s app, unless it authenticates by attestation, when oauth2.1 is) | Everything above, plus the rules below |
A fapi2 client is held to FAPI 2.0:
- It authenticates with
private_key_jwtand is DPoP-bound. It never holds a secret, is never a public app, and never authenticates by attestation. Every token request carries a DPoP proof, and every token it gets is bound to the proof’s key. FAPI 2.0 also allows mutual-TLS client authentication and certificate-bound tokens; afapi2client isn’t offered them. - Sign-in requests must be pushed first.
- No RS256, anywhere. Every algorithm the client names is ES256 or PS256:
tokenEndpointAuthSigningAlg,idTokenSignedResponseAlg,userinfoSignedResponseAlgandrequestObjectSigningAlgalike. - Its assertions may use only those of the realm’s
tokenEndpointAuthSigningAlgsthat are ES256 or PS256. The realm’s default list isES256andRS256, so by default afapi2client signs its assertions with ES256 alone. AddPS256to the realm’s list for clients that sign with it. - Its ID tokens are signed ES256 unless it asks for PS256, and so are its signed introspection answers.
- Its refresh tokens are not rotated:
refreshTokenRotation: rotateis refused. - A minute at most, both for clock tolerance on its assertions and for how long its sign-in code lives.
Set it up
Section titled “Set it up”Name the profile when you register the client (see Call the API):
curl 'https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client?id=payments-app' \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \ -H "Content-Type: application/json" \ -d '{ "status": "active", "clientName": "Payments", "securityProfile": "fapi2", "tokenEndpointAuthMethod": "private_key_jwt", "tokenEndpointAuthSigningAlg": "ES256", "jwks": { "keys": [ { "kty": "EC", "crv": "P-256", "kid": "pay-1", "x": "…", "y": "…" } ] }, "grantTypes": ["authorization_code", "refresh_token"], "redirectUris": ["https://pay.example.com/callback"], "scopes": ["openid", "payments:initiate"] }'You don’t set requirePushedAuthorizationRequests or dpopBoundAccessTokens: the profile forces both on.
| Where | Setting | What it does |
|---|---|---|
| Client | securityProfile | none, oauth2.1 or fapi2. Left out, an agent’s app is written fapi2, or oauth2.1 when it authenticates by attestation, and any other app is none |
| Realm | tokenEndpointAuthSigningAlgs | The algorithms any client’s assertions may use (ES256, RS256 by default). A fapi2 client uses only the ES256 and PS256 among them |
Limits and defaults
Section titled “Limits and defaults”| Setting or limit | Default | Range |
|---|---|---|
securityProfile | none; fapi2 for an agent’s client, oauth2.1 for an attesting agent’s | none, oauth2.1, fapi2 |
fapi2 clock tolerance and sign-in code life | at most 60 seconds | fixed |
fapi2 signing algorithms | ES256, PS256 | fixed |
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
Saving a fapi2 client is refused with a reason | A field the profile forbids (see Errors below) | Change the field the reason names |
A fapi2 app’s sign-in fails at once | It sends its sign-in request through the browser, not pushed | Push it first (Pushed authorization requests) |
invalid_dpop_proof from a fapi2 client | No DPoP proof on the token request | Send a proof on every token request |
Audit record
Section titled “Audit record”The profile is part of the client: setting or changing it is a change in Audit → Config. A request refused for
breaking the profile is a TOKEN_ISSUED record with result FAILED.
Good to know
Section titled “Good to know”- An agent’s app keeps a profile it names. One that must take plain bearer tokens names
none. - No EdDSA yet. FAPI 2.0 also allows EdDSA signatures; the realm doesn’t offer them. They are planned: Ed25519 signing.
- Requests are held to the profile, not only the registration. A
fapi2client’s sign-in request that wasn’t pushed is refused, and so is a token request without a DPoP proof (invalid_dpop_proof).
Reference
Section titled “Reference”Errors
Section titled “Errors”A client that can never meet fapi2 is refused when you write it (400), with the reason:
| Reason | When |
|---|---|
a fapi2 client takes no attestation as client authentication; an attesting agent's client is oauth2.1 | tokenEndpointAuthMethod is attest_jwt_client_auth |
a fapi2 client authenticates with private_key_jwt only | tokenEndpointAuthMethod is a secret method or none |
a fapi2 client's refresh tokens are not rotated (refreshTokenRotation: rotate) | refreshTokenRotation is rotate |
a fapi2 client signs only with ES256 or PS256 (<field> is RS256) | Any …SigningAlg or …SignedResponseAlg field names RS256 |
Related
Section titled “Related”- Hold a client to FAPI 2.0: the task, start to finish.
- DPoP: the token binding
fapi2requires. - Pushed authorization requests: the sign-in requests
fapi2requires. - Client authentication: the methods each profile allows.