| Status | Draft. |
| Version | 0.1.0, 2026-11-28 |
| Profile of | OpenID Connect Core 1.0 and the FAPI 2.0 Security Profile (Final) |
| Depends on | OCI-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 by | OCI-3 KYC (reuses the same authorization and token profile) |
| Reference implementation | packages/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:
- Authorization code flow only. PKCE
S256. Pushed authorization requests (PAR) are the only way in. - Sender-constrained access tokens, by DPoP. Client authentication with
private_key_jwt. - Providers are found, and relying parties are admitted, through OCI-1 trust chains and trust marks.
acrcarries 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
| Role | OCI-1 trust mark | Does |
|---|---|---|
| Identity provider (IdP) | https://oci.world/tm/role/identity_provider and an loa mark | Authorization server. Authenticates the resident, issues ID tokens. |
| Relying party (RP) | https://oci.world/tm/role/relying_party | Confidential client. Asks for a login. |
| Resident | none | Authenticates 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_providermetadata 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_providertrust mark. An RP MUST NOT start a login at an entity that does not. - AUTH-3.3 The
issuerin the IdP’sopenid_providermetadata 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, andrequire_pushed_authorization_requestsset totrue;response_types_supportedequal to["code"]andgrant_types_supportedincludingauthorization_code;code_challenge_methods_supportedequal to["S256"];token_endpoint_auth_methods_supportedequal to["private_key_jwt"], withtoken_endpoint_auth_signing_alg_values_supportedandid_token_signing_alg_values_supportedlimited to the algorithms of CORE-5.1;dpop_signing_alg_values_supported, limited the same way;authorization_response_iss_parameter_supportedset totrue;subject_types_supportedequal 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_idis 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 listautomaticinclient_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 andredirect_uriscome from its resolvedopenid_relying_partymetadata, after metadata policy. - AUTH-3.6 An IdP MUST refuse an RP that does not hold a valid
relying_partytrust 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_uriissued by the PAR endpoint. The RP MUST send onlyclient_idandrequest_urithere, and the IdP MUST ignore every other parameter at that endpoint. Arequest_uriMUST 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_idMUST equal the authenticated client. - AUTH-5.3
response_typeMUST becode.response_mode, if sent, MUST bequery. Arequestobject MUST be refused withrequest_not_supported. Arequest_uriinside a pushed request MUST be refused. OCI extension: JAR (RFC 9101) is out of scope for 0.1. - AUTH-5.4
code_challengeandcode_challenge_method=S256are REQUIRED.plainMUST 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_uriis REQUIRED and MUST exactly equal a value in the RP’s resolved metadata. It MUST be anhttpsURI without a fragment. OCI extension: no loopback or custom schemes in 0.1; native apps use claimedhttpslinks (RFC 8252 §7.2). - AUTH-5.6
scopeMUST includeopenid. OCI-2 defines no other scope, so any other value MUST be refused withinvalid_scope. (OCI-3 adds scopes.) - AUTH-5.7
nonceis REQUIRED and MUST NOT exceed 64 characters. OCI extension: OIDC Core makesnonceoptional in this flow; FAPI 2.0 §5.3.2.2 item 14 caps its length. - AUTH-5.8
acr_valuesis 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 withunmet_authentication_requirements. A value that is not an OCI acr URI MUST be refused withinvalid_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_partytrust mark (AUTH-3.6). Otherwise the IdP answersunauthorized_client. - AUTH-5.10 A parameter MUST NOT be repeated. (RFC 6749 §3.1.)
- AUTH-5.11
max_ageis OPTIONAL, a non-negative integer of seconds (OIDC Core §3.1.2.1).dpop_jktis OPTIONAL, a base64url SHA-256 JWK thumbprint (RFC 9449 §10).stateis OPTIONAL because PKCE and theisscheck 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-bearerand aclient_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
issandsubequal to theclient_id,audequal to the IdP’s issuer identifier as a single string, a uniquejti,iatandexp. The IdP MUST reject any otheraud, including an array. Algorithms are those of CORE-5.1. - AUTH-6.3
exp - iatMUST NOT exceed 60 seconds, and the IdP MUST reject a replayedjti. OCI extension. - AUTH-6.4 The IdP verifies the signature with the keys in the RP’s resolved
openid_relying_partymetadata (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
issin the authorization response. The RP MUST check thatissequals the issuer it sent the request to, and MUST refuse the response whenissis missing, different or repeated. Ifstatewas sent it MUST match. Anerrorresponse 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_verifierhashes to the storedcode_challenge. A mismatch isinvalid_grant. A verifier that is not 43 to 128 unreserved characters isinvalid_request. (RFC 7636 §4.1, §4.6.) - AUTH-7.3 If a
dpop_jktwas pushed, the DPoP proof at the token endpoint MUST be made with that key (RFC 9449 §10). When the PAR request carried aDPoPheader and nodpop_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/auth0.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
DPoPheader, holding one well-formed JWT. Zero or several are refused. (§4.3 item 1.) - AUTH-8.2 The proof MUST have
typdpop+jwt, analgfrom CORE-5.1, and ajwkholding a public key. Ajwkwith private members (d,p,q,dp,dq,qi,oth,k) MUST be refused. The signature MUST verify with thatjwk.jti,htm,htuandiatare REQUIRED.jtiMUST NOT exceed 256 characters. (§4.2, §4.3 items 2 to 7.) - AUTH-8.3
htmMUST equal the request method.htuMUST equal the request URI, comparing scheme, authority and path only. (§4.3 items 8 and 9.) - AUTH-8.4
iatMUST 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
jtiit has already accepted inside the acceptance window. It MUST record thejtionly 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_nonceand 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), analgfrom CORE-5.1 andtypJWT. It MUST be verified with keys from the IdP’s resolved metadata. OCI extension: OIDC defines notypfor ID tokens, so OCI requires the genericJWTto meet CORE-5.4. -
AUTH-9.2 The RP MUST check:
issequals the issuer (AUTH-3.3);audholds the RP’sclient_id;exphas not passed;iatis not later than now plus the skew (CORE-6.3);subis 1 to 255 characters. Skew MUST NOT exceed 60 seconds (CORE-6.2).iss,sub,aud,iatandexpare REQUIRED. -
AUTH-9.3 When
audhas more than one value,azpMUST be present. Whenazpis present it MUST equal theclient_id. OCI extension: OIDC Core §3.1.3.7 makes the first check a SHOULD. -
AUTH-9.4
nonceMUST be present and equal the value sent (OIDC Core §3.1.3.7 item 11). -
AUTH-9.5
acris REQUIRED. Its values are:acrOCI LoA https://oci.world/acr/lowlowhttps://oci.world/acr/substantialsubstantialhttps://oci.world/acr/highhighAny other
acrMUST 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 leavesacrvalues to the deployment. -
AUTH-9.6 The level that counts is the lower of the token’s
acrand the IdP’s assurance level resolved through OCI-1 (TR-4.6, including any cross-country cap). An IdP MUST NOT return anacrabove its own trust mark. -
AUTH-9.7 When
max_agewas sent,auth_timeMUST be present and the authentication MUST be no older thanmax_ageplus the skew (OIDC Core §3.1.3.7 item 13). -
AUTH-9.8
subMUST 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 thaniss,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_requirementswhen 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
issresponse 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:
jtistores 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
ES256andPS256. FAPI 2.0 §5.4.1 also allowsEdDSA. CORE-5.2 excludes it for now. - Phishing resistance:
highassurance 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.
| Clauses | Checked by @oci/auth tests |
|---|---|
| AUTH-5.2 to 5.11 | validatePushedAuthorizationRequest |
| AUTH-5.4, 7.2 | generateCodeVerifier, codeChallengeS256, verifyCodeVerifier |
| AUTH-7.1 | validateAuthorizationResponse |
| AUTH-7.3, 8.1 to 8.7 | verifyDpopProof |
| AUTH-9.1 to 9.7 | validateIdToken |
| AUTH-3.x, 5.1, 6.x, 7.4 to 7.6, 9.8, 10.x | Not checked in code in 0.1. They need a running IdP or RP. The OCI conformance suite checks them. |
15. Open questions
- Deriving
allowedLoasfrom the chain.PushedAuthorizationContext.allowedLoasis supplied by the caller. The reference library offersloasUpTo(max)(every level up to the provider’s chain-provenoci.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 thatallowedLoasMUST NOT exceed the provider’s OCI-1 assurance (TR-4.6) and the client’s cap. - Should
acr_valuesallow a preference list, as OIDC Core does, instead of exactly one value (AUTH-5.8)? And should OCI also accept the eIDAS URIshttp://eidas.europa.eu/LoA/*as aliases for countries that need them (CORE-4.2)? - Is
typJWTright for ID tokens (AUTH-9.1), or should OCI define a profile-specifictypand 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
highassurance 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
| Version | Date | What changed |
|---|---|---|
| 0.1.0 | 2026-11-28 | First 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). |