This page is for Authlete 2.x. For 3.x documentation, see this page.
Overview
This document explains how to support FAPI 2.0 Security Profile in Authlete.“FAPI 2.0 Security Profile” is available since Authlete 2.3.
Preconditions
- This document uses Authorization Code Flow compliant with FAPI 2.0 Security Profile as an example.
private_key_jwtis used for client authentication.- DPoP is used for sender-constrained access tokens.

Service Settings
Configure your service as follows.☑️ Basic > Token Issuer Identifier

☑️ Basic > Supported Service Profile

FAPI.
☑️ Authorization > Supported Grant Types

AUTHORIZATION_CODE.
☑️ Authorization > Supported Response Types

CODE.
☑️ Authorization > Authorization Endpoint > Authorization Endpoint URI

☑️ Authorization > Authorization Endpoint > iss Response Parameter

Included.
“FAPI 2.0 Security Profile, 5.3.2. Requirements for authorization servers, 5.3.2.2. Authorization endpoint flows”
- shall return an
issparameter in the authorization response according to [RFC9207];
☑️ Authorization > Authorization Endpoint > Variability of Loopback Redirection URI

Variable.
“FAPI 2.0 Security Profile, 5.3.2. Requirements for authorization servers, 5.3.2.2. Authorization endpoint flows”
- shall not transmit authorization responses over unencrypted network connections, and, to this end, shall not allow redirect URIs that use the “http” scheme except for native clients that use loopback interface Redirection as described in Section 7.3 of [RFC8252];
☑️ Authorization > Token Endpoint > Token Endpoint URI

☑️ Authorization > Token Endpoint > Supported Client Authentication Methods

PRIVATE_KEY_JWT.
“FAPI 2.0 Security Profile, 5.3.2. Requirements for authorization servers, 5.3.2.1. General requirements”
- shall authenticate clients using one of the following methods:
- MTLS as specified in Section 2 of [RFC8705], or
private_key_jwtas specified in Section 9 of [OIDC];
☑️ Authorization > Token Endpoint > Assertion Audience Mode

Restrict.
“FAPI 2.0 Security Profile, 5.3.2. Requirements for authorization servers, 5.3.2.1. General requirements”
- shall only accept its issuer identifier value (as defined in [RFC8414]) as a string in the aud claim received in client authentication assertions;
☑️ Authorization > Pushed Authorization Request Endpoint > Pushed Authorization Request Endpoint

☑️ Authorization > Pushed Authorization Request Endpoint > Pushed Authorization Request Duration

“FAPI 2.0 Security Profile, 5.3.2. Requirements for authorization servers, 5.3.2.2. Authorization endpoint flows”
- shall issue pushed authorization requests request_uri with expires_in values of less than 600 seconds;
☑️ Token > Refresh Token > Refresh Token Continuous Use

Kept.
“FAPI 2.0 Security Profile, 5.3.2. Requirements for authorization servers, 5.3.2.1. General requirements”
- shall not use refresh token rotation except in extraordinary circumstances (see Note 1 below);
… NOTE 1: The use of refresh token rotation does not provide security benefits when used with confidential clients and sender-constrained access tokens. This specification prohibits the use of refresh token rotation for security reasons as it causes user experience degradation and operational issues whenever the client fails to store or receive the new refresh token and has no option to retry. However, as refresh token rotation may be required from time to time for infrastructure migration or similar extraordinary circumstances, this specification allows it, provided that authorization servers offer clients the time-limited option to retry with the old refresh token in case of failure. Implementers need to consider a secure mechanism for clients to recover from a loss of a new refresh token on issue. The details of this mechanism are outside the scope of this specification.
☑️ Token > Scope > Supported Scopes


myscope and add a scope attribute with the key fapi2 and the value sp.
☑️ ID Token > Allowable Clock Skew

“FAPI 2.0 Security Profile, 5.3.2. Requirements for authorization servers, 5.3.2.1. General requirements”
- to accommodate clock offsets, shall accept JWTs with an iat or nbf timestamp between 0 and 10 seconds in the future but shall reject JWTs with an iat or nbf timestamp greater than 60 seconds in the future. See Note 3 for further details and rationale;
… NOTE 3: Clock skew is a cause of many interoperability issues. Even a few hundred milliseconds of clock skew can cause JWTs to be rejected for being “issued in the future”. The DPoP specification [RFC9449] suggests that JWTs are accepted in the reasonably near future (on the order of seconds or minutes). This document goes further by requiring authorization servers to accept JWTs that have timestamps up to 10 seconds in the future. 10 seconds was chosen as a value that does not affect security while greatly increasing interoperability. Implementers are free to accept JWTs with a timestamp of up to 60 seconds in the future. Some ecosystems have found that the value of 30 seconds is needed to fully eliminate clock skew issues. To prevent implementations switching off iat and nbf checks completely this document imposes a maximum timestamp in the future of 60 seconds.
Client Configurations
Configure your client as follows.☑️ Basic > Client Type

CONFIDENTIAL.
☑️ Authorization > Grant Types

AUTHORIZATION_CODE.
☑️ Authorization > Response Types

CODE.
☑️ Authorization > Redirect URIs

https.
☑️ Authorization > Token Endpoint > Client Authentication Method

PRIVATE_KEY_JWT.
“FAPI 2.0 Security Profile, 5.3.3. Requirements for clients, 5.3.3.1. General requirements”
- shall support client authentication using one or both of the following methods:
- MTLS as specified in Section 2 of [RFC8705],
private_key_jwtas specified in Section 9 of [OIDC];
☑️ Authorization > Token Endpoint > Assertion Signature Algorithm

ES256.
“FAPI 2.0 Security Profile, 5.4. Cryptography and secrets, 5.4.1. General requirements”
- Authorization servers, clients, and resource servers when creating or processing JWTs shall:
- adhere to [RFC8725];
- use
PS256,ES256, orEdDSA(using theEd25519variant) algorithms; and- not use or accept the
nonealgorithm.
☑️ JWK Set > JWK Set Content

private_key_jwt for client authentication, the JWK set must include a signing key for client assertions. Note that keys contained in the JWK set must satisfy the following requirements.
“FAPI 2.0 Security Profile, 5.4. Cryptography and secrets, 5.4.1. General requirements”
- RSA keys shall have a minimum length of 2048 bits.
- Elliptic curve keys shall have a minimum length of 224 bits.
Demonstration
This section demonstrates the Authorization Code Flow defined in the FAPI 2.0 Security Profile by using Authlete APIs.1. Pushed Authorization Request & Response

☑️ Client Authentication
The client usesprivate_key_jwt for client authentication at the pushed authentication request endpoint (as configured above).
☑️ Scope
Thescope request parameter includes myscope, which is linked to an attribute fapi2=sp as configured above.
☑️ Response Type
Theresponse_type request parameter is set to code.
“FAPI 2.0 Security Profile, 5.3.3. Requirements for clients, 5.3.3.2. Authorization code flow”
- shall use the authorization code grant described in [RFC6749];
☑️ PKCE
Thecode_challenge request parameter must be set to an appropriate value and the code_challenge_method request parameter must be set to S256.
“FAPI 2.0 Security Profile, 5.3.3. Requirements for clients, 5.3.3.2. Authorization code flow”
- shall use PKCE [RFC7636] with
S256as the code challenge method
☑️ Redirect URI
Theredirect_uri request parameter must be set and it must be a URI starting with https. In this demonstration, we use the redirect URI registered in the client settings.
“FAPI2 Security Profile, 5.3.2. Requirements for authorization servers, 5.3.2.2. Authorization endpoint flows”
- shall require the
redirect_uriparameter in pushed authorization requests
- shall not transmit authorization responses over unencrypted network connections, and, to this end, shall not allow redirect URIs that use the “http” scheme except for native clients that use loopback interface Redirection as described in Section 7.3 of [RFC8252];
/pushed_auth_req API including the received parameters.
Below is a curl command that simulates a request from the authorization server to Authlete /pushed_auth_req API.
2. Authorization Request & Response

/auth/authorization API.
Below is a curl command that simulates a request from the authorization server to Authlete /auth/authorization API.
/auth/authorization API, the end-user authorizes/denies the client’s request in the browser. The authorization result is then conveyed to the authorization server and the authorization server calls Authlete /auth/authorization/issue API with the result.
Below is a curl command that simulates a request from the authorization server to Authlete /auth/authorization/issue API.
3. Token Request & Response

private_key_jwt. Also, we assume that the authorization server issues access tokens that are sender-constrained with DPoP based on the following requirements:
“FAPI 2.0 Security Profile, 5.3.2. Requirements for authorization servers, 5.3.2.1. General requirements”
- shall only issue sender-constrained access tokens,
- shall use one of the following methods for sender-constrained access tokens:
- MTLS as described in [RFC8705],
- DPoP as described in [RFC9449];
“FAPI 2.0 Security Profile, 5.3.3. Requirements for clients, 5.3.3.1. General requirements”
- shall support sender-constrained access tokens using one or both of the following methods:
- MTLS as described in [RFC8705],
- DPoP as described in [RFC9449];
PS256, ES256 or EdDSA.
“FAPI 2.0 Security Profile, 5.4. Cryptography and secrets, 5.4.1. General requirements”Taking the requirements above into account, a request to the token endpoint would look like as below.
- Authorization servers, clients, and resource servers when creating or processing JWTs shall:
- adhere to [RFC8725];
- use
PS256,ES256, orEdDSA(using theEd25519variant) algorithms; and- not use or accept the
nonealgorithm.
/auth/token API.
Below is a curl command that simulates a request from the authorization server to Authlete /auth/token API.
4. Protected Resource

/auth/introspection API to verify the access token.
Below is a curl command that simulates a request from the resource server to Authlete /auth/introspection API.