← Specifications

OCI-2 ID Auth

Version 0.1.0 · 2026-11-28 · Draft Changes
StatusDraft.
Version0.1.0, 2026-11-28
Profile ofOpenID Connect Core 1.0 and the FAPI 2.0 Security Profile (Final)
Depends onOCI-0 Core, OCI-1 Trust Registry. Standards: RFC 7636 (PKCE), RFC 9126 (PAR), RFC 9449 (DPoP), RFC 9207 (iss response parameter), RFC 7523 (JWT client assertions), RFC 8414 (AS metadata), RFC 8705 (mTLS, optional)
Used byOCI-3 KYC (reuses the same authorization and token profile)
Reference implementationpackages/auth (@oci/auth)

1. Purpose

OCI-2 is “Sign in with your national ID”. A resident proves who they are to a service, and the service gets a stable identifier for that resident and the assurance level reached. It releases no other personal data. Verified claims travel under OCI-3.

OCI-2 adds no new protocol. It narrows OpenID Connect Core 1.0 (authorization code flow) to the FAPI 2.0 Security Profile and ties it to OCI-1 so no client registration is needed:

  1. Authorization code flow only. PKCE S256. Pushed authorization requests (PAR) are the only way in.
  2. Sender-constrained access tokens, by DPoP. Client authentication with private_key_jwt.
  3. Providers are found, and relying parties are admitted, through OCI-1 trust chains and trust marks.
  4. acr carries an OCI assurance level (OCI-0 §4).

A conforming provider and relying party are valid FAPI 2.0 participants. Anything the FAPI profile forbids, OCI-2 forbids.

2. Roles

RoleOCI-1 trust markDoes
Identity provider (IdP)https://oci.world/tm/role/identity_provider and an loa markAuthorization server. Authenticates the resident, issues ID tokens.
Relying party (RP)https://oci.world/tm/role/relying_partyConfidential client. Asks for a login.
ResidentnoneAuthenticates at the IdP in a user agent.

3. Trust and discovery

  • AUTH-3.1 An IdP is identified by its OCI-1 entity identifier (CORE-3.1). An RP finds the IdP’s metadata by resolving that entity through OCI-1 (TR-2 to TR-6) against a trust anchor it pins. The RP MUST use the resolved openid_provider metadata and MUST NOT use any other source for endpoints or keys. (FAPI 2.0 §5.3.3.1 items 9 to 11; OpenID Federation 1.0 §5.1.3.)
  • AUTH-3.2 The resolved IdP MUST carry a valid identity_provider trust mark. An RP MUST NOT start a login at an entity that does not.
  • AUTH-3.3 The issuer in the IdP’s openid_provider metadata MUST equal its entity identifier. OCI extension.
  • AUTH-3.4 The IdP’s metadata MUST include (names from RFC 8414, RFC 9126 §5, RFC 9207 §3, RFC 9449 §5.1 and OIDC Discovery):
    • pushed_authorization_request_endpoint, and require_pushed_authorization_requests set to true;
    • response_types_supported equal to ["code"] and grant_types_supported including authorization_code;
    • code_challenge_methods_supported equal to ["S256"];
    • token_endpoint_auth_methods_supported equal to ["private_key_jwt"], with token_endpoint_auth_signing_alg_values_supported and id_token_signing_alg_values_supported limited to the algorithms of CORE-5.1;
    • dpop_signing_alg_values_supported, limited the same way;
    • authorization_response_iss_parameter_supported set to true;
    • subject_types_supported equal to ["pairwise"] (AUTH-9.8);
    • acr_values_supported, a subset of the URIs in AUTH-9.5.
  • AUTH-3.5 An RP’s trust chain is resolved by the IdP when the RP’s first request arrives. The RP’s client_id is its entity identifier. No separate registration step exists. (OpenID Federation 1.0 §12.1, Automatic Registration, using §12.1.1.2 pushed authorization.) The IdP MUST list automatic in client_registration_types_supported, and the RP MUST resolve the IdP’s trust chain before it sends any request (§12.1). The RP MUST use the same client authentication method, private_key_jwt, on every request (§12.1.4). The RP’s keys and redirect_uris come from its resolved openid_relying_party metadata, after metadata policy.
  • AUTH-3.6 An IdP MUST refuse an RP that does not hold a valid relying_party trust mark (AUTH-5.9). An RP’s trust mark cannot be taken from the request. It MUST come from OCI-1 resolution.

4. Flow

 RP                              IdP                          Resident (user agent)
  |  resolve IdP via OCI-1        |                                  |
  |  POST /par  (private_key_jwt, DPoP, PKCE challenge)              |
  |------------------------------>|                                  |
  |  201 { request_uri, expires_in }                                 |
  |<------------------------------|                                  |
  |  redirect: /authorize?client_id=..&request_uri=..                |
  |----------------------------------------------------------------->|
  |                               |  authenticate (LoA per acr)      |
  |                               |<-------------------------------->|
  |  redirect: redirect_uri?code=..&iss=..&state=..                  |
  |<-----------------------------------------------------------------|
  |  POST /token (code, code_verifier, private_key_jwt, DPoP)        |
  |------------------------------>|                                  |
  |  { access_token (DPoP), id_token }                               |
  |<------------------------------|                                  |

5. Pushed authorization request

Profiles RFC 9126 §2.1, OIDC Core §3.1.2.1, RFC 7636 and FAPI 2.0 §5.3.2.2.

  • AUTH-5.1 The authorization endpoint MUST reject any request that does not use a request_uri issued by the PAR endpoint. The RP MUST send only client_id and request_uri there, and the IdP MUST ignore every other parameter at that endpoint. A request_uri MUST be single-use, bound to the client that pushed it, and live less than 600 seconds. (FAPI 2.0 §5.3.2.2 items 3 and 12; RFC 9126 §2.2 and §4.)
  • AUTH-5.2 The PAR request MUST be client-authenticated (AUTH-6). Its client_id MUST equal the authenticated client.
  • AUTH-5.3 response_type MUST be code. response_mode, if sent, MUST be query. A request object MUST be refused with request_not_supported. A request_uri inside a pushed request MUST be refused. OCI extension: JAR (RFC 9101) is out of scope for 0.1.
  • AUTH-5.4 code_challenge and code_challenge_method=S256 are REQUIRED. plain MUST be refused. The challenge is the base64url of a SHA-256 hash, 43 characters. The RP MUST make a new verifier per request. (RFC 7636 §4.2; FAPI 2.0 §5.3.2.2 item 5, §5.3.3.2 items 3 and 4.)
  • AUTH-5.5 redirect_uri is REQUIRED and MUST exactly equal a value in the RP’s resolved metadata. It MUST be an https URI without a fragment. OCI extension: no loopback or custom schemes in 0.1; native apps use claimed https links (RFC 8252 §7.2).
  • AUTH-5.6 scope MUST include openid. OCI-2 defines no other scope, so any other value MUST be refused with invalid_scope. (OCI-3 adds scopes.)
  • AUTH-5.7 nonce is REQUIRED and MUST NOT exceed 64 characters. OCI extension: OIDC Core makes nonce optional in this flow; FAPI 2.0 §5.3.2.2 item 14 caps its length.
  • AUTH-5.8 acr_values is REQUIRED and MUST hold exactly one OCI acr URI (AUTH-9.5), the lowest level the RP accepts. A value the IdP may not offer this RP MUST be refused with unmet_authentication_requirements. A value that is not an OCI acr URI MUST be refused with invalid_request. OCI extension: OIDC Core §3.1.2.1 allows a preference list; 0.1 uses one value so the minimum is unambiguous.
  • AUTH-5.9 The RP MUST hold a valid relying_party trust mark (AUTH-3.6). Otherwise the IdP answers unauthorized_client.
  • AUTH-5.10 A parameter MUST NOT be repeated. (RFC 6749 §3.1.)
  • AUTH-5.11 max_age is OPTIONAL, a non-negative integer of seconds (OIDC Core §3.1.2.1). dpop_jkt is OPTIONAL, a base64url SHA-256 JWK thumbprint (RFC 9449 §10). state is OPTIONAL because PKCE and the iss check already defend the flow (AUTH-7.1).

6. Client authentication

Profiles OIDC Core §9 (private_key_jwt), RFC 7523 §2.2 and FAPI 2.0 §5.3.2.1 items 6 and 8. It applies to the PAR and token endpoints.

  • AUTH-6.1 The request carries client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer and a client_assertion. Other client authentication methods MUST be refused. OCI extension: mTLS client authentication (RFC 8705) is not used in 0.1.
  • AUTH-6.2 The assertion MUST have iss and sub equal to the client_id, aud equal to the IdP’s issuer identifier as a single string, a unique jti, iat and exp. The IdP MUST reject any other aud, including an array. Algorithms are those of CORE-5.1.
  • AUTH-6.3 exp - iat MUST NOT exceed 60 seconds, and the IdP MUST reject a replayed jti. OCI extension.
  • AUTH-6.4 The IdP verifies the signature with the keys in the RP’s resolved openid_relying_party metadata (AUTH-3.5).

@oci/auth 0.1 does not verify client assertions. Use a JOSE library with the rules above (CORE-5.7).

7. Authorization response and token request

  • AUTH-7.1 The IdP MUST return iss in the authorization response. The RP MUST check that iss equals the issuer it sent the request to, and MUST refuse the response when iss is missing, different or repeated. If state was sent it MUST match. An error response MUST end the login. (RFC 9207 §2.4; FAPI 2.0 §5.3.3.2 item 5.)
  • AUTH-7.2 The IdP MUST check that code_verifier hashes to the stored code_challenge. A mismatch is invalid_grant. A verifier that is not 43 to 128 unreserved characters is invalid_request. (RFC 7636 §4.1, §4.6.)
  • AUTH-7.3 If a dpop_jkt was pushed, the DPoP proof at the token endpoint MUST be made with that key (RFC 9449 §10). When the PAR request carried a DPoP header and no dpop_jkt, the IdP MUST bind the code to that header’s key. RFC 9449 §10 allows either route. Verify the exact text before this clause is final.
  • AUTH-7.4 An authorization code MUST live at most 60 seconds and MUST be single-use. A second use MUST fail, and SHOULD revoke tokens already issued from that code. (FAPI 2.0 §5.3.2.1 item 11, §5.3.2.2 item 9.)
  • AUTH-7.5 Access tokens MUST be sender-constrained (AUTH-8). An IdP MAY also support mTLS-bound tokens (RFC 8705). @oci/auth 0.1 covers DPoP only.
  • AUTH-7.6 OCI-2 access tokens grant nothing beyond identity. The IdP MUST NOT release claims beyond sub, acr, amr, auth_time (AUTH-9.8). Refresh tokens MUST NOT be issued. OCI extension: a login is one-shot; use OCI-3 for repeated access. This clause applies to sign-in (login) grants. It does not apply to an OCI-CONSENT-1 grant, a separate grant for data access with its own rules for refresh tokens (CDA-9.2 to CDA-9.4), which is never accepted as a login (CDA-9.5).

8. DPoP

Profiles RFC 9449 §4.2, §4.3, §7.1, §8 and §11.1, and FAPI 2.0 §5.3.2.1 items 4, 5, 10, 12 and 13.

  • AUTH-8.1 A request MUST carry exactly one DPoP header, holding one well-formed JWT. Zero or several are refused. (§4.3 item 1.)
  • AUTH-8.2 The proof MUST have typ dpop+jwt, an alg from CORE-5.1, and a jwk holding a public key. A jwk with private members (d, p, q, dp, dq, qi, oth, k) MUST be refused. The signature MUST verify with that jwk. jti, htm, htu and iat are REQUIRED. jti MUST NOT exceed 256 characters. (§4.2, §4.3 items 2 to 7.)
  • AUTH-8.3 htm MUST equal the request method. htu MUST equal the request URI, comparing scheme, authority and path only. (§4.3 items 8 and 9.)
  • AUTH-8.4 iat MUST NOT be more than 60 seconds old and MUST NOT be more than 10 seconds in the future. A verifier MAY widen these to at most 300 seconds old and 60 seconds ahead, never further. (§4.3 item 11; FAPI 2.0 §5.3.2.1 item 13 allows 10 seconds ahead and refuses more than 60; CORE-6.2.)
  • AUTH-8.5 When a proof accompanies an access token, it MUST carry ath, the base64url SHA-256 of the token. Its key MUST equal the key the token is bound to (cnf.jkt, §6.1). A verifier MUST be given the bound key, and MUST NOT accept a token without one. (§4.3 item 12, §7.1.)
  • AUTH-8.6 A verifier MUST refuse a jti it has already accepted inside the acceptance window. It MUST record the jti only after every other check has passed, and MUST scope it by proof key. The store is the caller’s. A deployment with several nodes MUST use a shared store. (§11.1.)
  • AUTH-8.7 An IdP MAY require a server nonce (§8). An RP MUST support use_dpop_nonce and retry once. (FAPI 2.0 §5.3.3.1 item 8.)

Error mapping. A DPoP failure at an IdP is an invalid_dpop_proof error (RFC 9449 §5). The library codes dpop_*, expired and iat_in_future all map to it. dpop_nonce_required maps to use_dpop_nonce with a DPoP-Nonce header. dpop_replay maps to invalid_dpop_proof.

9. ID token and assurance

Profiles OIDC Core §2, §3.1.3.7 and FAPI 2.0 §5.3.2.3.

  • AUTH-9.1 An ID token is a JWS with a kid (CORE-5.3), an alg from CORE-5.1 and typ JWT. It MUST be verified with keys from the IdP’s resolved metadata. OCI extension: OIDC defines no typ for ID tokens, so OCI requires the generic JWT to meet CORE-5.4.

  • AUTH-9.2 The RP MUST check: iss equals the issuer (AUTH-3.3); aud holds the RP’s client_id; exp has not passed; iat is not later than now plus the skew (CORE-6.3); sub is 1 to 255 characters. Skew MUST NOT exceed 60 seconds (CORE-6.2). iss, sub, aud, iat and exp are REQUIRED.

  • AUTH-9.3 When aud has more than one value, azp MUST be present. When azp is present it MUST equal the client_id. OCI extension: OIDC Core §3.1.3.7 makes the first check a SHOULD.

  • AUTH-9.4 nonce MUST be present and equal the value sent (OIDC Core §3.1.3.7 item 11).

  • AUTH-9.5 acr is REQUIRED. Its values are:

    acrOCI LoA
    https://oci.world/acr/lowlow
    https://oci.world/acr/substantialsubstantial
    https://oci.world/acr/highhigh

    Any other acr MUST be refused. The RP MUST refuse a token whose level is below the level it asked for (CORE-4.1). A higher level is accepted. OCI extension: OIDC leaves acr values to the deployment.

  • AUTH-9.6 The level that counts is the lower of the token’s acr and the IdP’s assurance level resolved through OCI-1 (TR-4.6, including any cross-country cap). An IdP MUST NOT return an acr above its own trust mark.

  • AUTH-9.7 When max_age was sent, auth_time MUST be present and the authentication MUST be no older than max_age plus the skew (OIDC Core §3.1.3.7 item 13).

  • AUTH-9.8 sub MUST be pairwise per RP (OIDC Core §8.1). It MUST NOT be, or contain, a national ID number. The ID token MUST NOT contain claims other than iss, sub, aud, iat, exp, nonce, acr, amr, auth_time, azp. OCI extension. This keeps RPs from correlating residents, and puts anything richer behind OCI-3 consent.

10. Errors

  • AUTH-10.1 HTTP errors follow CORE-9.1. Authorization errors use the codes of RFC 6749 §4.1.2.1 and OIDC Core §3.1.2.6, including unmet_authentication_requirements when the IdP cannot meet the requested level.
  • AUTH-10.2 Error descriptions MUST NOT include the resident’s identifiers or anything about their record.

11. Worked example

Metadata of the IdP at https://id.home.example (the openid_provider part of its OCI-1 entity configuration):

{
  "issuer": "https://id.home.example",
  "authorization_endpoint": "https://id.home.example/authorize",
  "token_endpoint": "https://id.home.example/token",
  "pushed_authorization_request_endpoint": "https://id.home.example/par",
  "require_pushed_authorization_requests": true,
  "jwks_uri": "https://id.home.example/jwks",
  "scopes_supported": ["openid"],
  "response_types_supported": ["code"],
  "grant_types_supported": ["authorization_code"],
  "subject_types_supported": ["pairwise"],
  "id_token_signing_alg_values_supported": ["ES256"],
  "token_endpoint_auth_methods_supported": ["private_key_jwt"],
  "token_endpoint_auth_signing_alg_values_supported": ["ES256"],
  "code_challenge_methods_supported": ["S256"],
  "dpop_signing_alg_values_supported": ["ES256"],
  "authorization_response_iss_parameter_supported": true,
  "acr_values_supported": ["https://oci.world/acr/low", "https://oci.world/acr/substantial", "https://oci.world/acr/high"]
}

Pushed request from the RP https://tax.home.example, as a form body (shown as JSON), with the client assertion and DPoP header omitted:

{
  "client_id": "https://tax.home.example",
  "response_type": "code",
  "redirect_uri": "https://tax.home.example/cb",
  "scope": "openid",
  "code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
  "code_challenge_method": "S256",
  "nonce": "n-0S6_WzA2Mj",
  "state": "af0ifjsldkj",
  "acr_values": "https://oci.world/acr/substantial",
  "max_age": "300"
}

DPoP proof at the token endpoint (header, then payload):

{ "typ": "dpop+jwt", "alg": "ES256", "jwk": { "kty": "EC", "crv": "P-256", "x": "...", "y": "..." } }
{ "jti": "b1f4c6a2-0d6e-4f0a-9c1c-7d1e2a3b4c5d", "htm": "POST", "htu": "https://id.home.example/token", "iat": 1794996000 }

ID token claims:

{
  "iss": "https://id.home.example",
  "sub": "pw-7f3a91c2d4",
  "aud": "https://tax.home.example",
  "iat": 1794996005,
  "exp": 1794996305,
  "nonce": "n-0S6_WzA2Mj",
  "acr": "https://oci.world/acr/substantial",
  "amr": ["otp", "pin"],
  "auth_time": 1794995990
}

12. Security considerations

  • Mix-up attacks are stopped by the iss response parameter (AUTH-7.1) and by resolving the IdP only through OCI-1 (AUTH-3.1).
  • Code interception is stopped by PKCE, the 60-second single-use code, and the DPoP binding of the code (AUTH-7.3).
  • Stolen access tokens are useless without the DPoP key (AUTH-8.5). OCI-2 tokens carry no data worth stealing (AUTH-7.6).
  • The provider LoA ceiling (CORE-4.1) is a required ID-token option; a verifier that has no provider LoA must pass providerLoa: 'unchecked' explicitly, so the check is never skipped by accident.
  • Replay: jti stores need a shared, expiring store (AUTH-8.6). The store only needs to hold entries for the acceptance window, so size is bounded by request rate.
  • Fetching an RP’s or IdP’s metadata is an SSRF risk. TR-7 applies unchanged.
  • Algorithms: only ES256 and PS256. FAPI 2.0 §5.4.1 also allows EdDSA. CORE-5.2 excludes it for now.
  • Phishing resistance: high assurance needs a device-bound, phishing-resistant authenticator (CORE-4). How the IdP does that is not defined here.

13. Privacy considerations

  • Pairwise sub (AUTH-9.8) stops two RPs from joining their records on a national ID number.
  • The login releases no claims beyond identity and assurance. Each RP learns the resident logged in, when, and at what level (CORE-7.1).
  • IdPs MUST NOT log national ID numbers, authenticators or authentication secrets in clear text (CORE-7.3).
  • An IdP can see every RP a resident signs in to. OCI-2 does not hide this. Countries SHOULD limit IdP logs to what audit needs, and OCI-5 receipts give the resident their own record.

14. Conformance

An implementation conforms to OCI-2 0.1 when it passes every test in packages/auth/test tagged with an AUTH clause, and the OpenID Foundation FAPI 2.0 Security Profile tests (with private_key_jwt and DPoP) against its IdP or RP.

ClausesChecked by @oci/auth tests
AUTH-5.2 to 5.11validatePushedAuthorizationRequest
AUTH-5.4, 7.2generateCodeVerifier, codeChallengeS256, verifyCodeVerifier
AUTH-7.1validateAuthorizationResponse
AUTH-7.3, 8.1 to 8.7verifyDpopProof
AUTH-9.1 to 9.7validateIdToken
AUTH-3.x, 5.1, 6.x, 7.4 to 7.6, 9.8, 10.xNot checked in code in 0.1. They need a running IdP or RP. The OCI conformance suite checks them.

15. Open questions

  • Deriving allowedLoas from the chain. PushedAuthorizationContext.allowedLoas is supplied by the caller. The reference library offers loasUpTo(max) (every level up to the provider’s chain-proven oci.assurance), but nothing forces a caller to use it, and the library cannot read the chain (auth does not depend on trust). Decide whether OCI-2 should state that allowedLoas MUST NOT exceed the provider’s OCI-1 assurance (TR-4.6) and the client’s cap.
  • Should acr_values allow a preference list, as OIDC Core does, instead of exactly one value (AUTH-5.8)? And should OCI also accept the eIDAS URIs http://eidas.europa.eu/LoA/* as aliases for countries that need them (CORE-4.2)?
  • Is typ JWT right for ID tokens (AUTH-9.1), or should OCI define a profile-specific typ and ask IdPs to emit it?
  • Client assertion lifetime of 60 seconds (AUTH-6.3) is an OCI choice. Check it against OpenID Foundation conformance test behaviour.
  • Does high assurance require DPoP keys held in secure hardware, so that the resident’s device key and the RP’s DPoP key are linked? Needs a joint decision with OCI-4.
  • Should mTLS-bound tokens (RFC 8705) be a required option for IdPs that sit behind a national gateway?

Changes

VersionDateWhat changed
0.1.02026-11-28First versioned release: the text of Draft 0.1 (2026-11-18). For OCI-CONSENT-1: AUTH-7.6 (no refresh tokens) applies to login grants, not to CDA grants (CDA-9).