Skip to content

Commit 2e7501e

Browse files
Refine FAPI 2.0 documentation for Duende IdentityServer
Updated feature details, corrected terminology, and enhanced clarity in configuration examples.
1 parent fa319ee commit 2e7501e

File tree

1 file changed

+45
-39
lines changed

1 file changed

+45
-39
lines changed

src/content/docs/identityserver/tokens/fapi-2-0-specification.md

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ sidebar:
88
variant: tip
99
---
1010

11-
:::note
12-
Available **ONLY** in Duende IdentityServer 7.3+
13-
:::
11+
<span data-shb-badge data-shb-badge-variant="default">Added in 7.3</span>
1412

15-
The FAPI 2.0 Security Profile is an API security profile based on the OAuth 2.0 Authorization Framework. Its goal is to protect APIs in high-value scenarios and is a set of OAuth Security best current practice (BCP) recommendations. These high-value scenarios include assets typically deployed in the fields of e-health and e-government, which may provide consumers with sensitive data and mission-critical functionality.
13+
The [FAPI 2.0 Security Profile](https://openid.net/specs/fapi-security-profile-2_0-final.html) is an API security profile based on the OAuth 2.0 Authorization Framework. Its goal is to protect APIs in high-value scenarios and is a set of OAuth Security best current practice (BCP) recommendations. These high-value scenarios include assets typically deployed in the fields of e-health and e-government, which may provide consumers with sensitive data and mission-critical functionality.
1614

17-
Duende Identity Server implements the FAPI 2.0 BCP features so you can build, deploy, and maintain a FAPI 2.0 Security profile as part of your overall security posture. Let's discuss what those features are and how to enable them.
15+
Duende IdentityServer implements the FAPI 2.0 BCP features so you can build, deploy, and maintain a FAPI 2.0 Security profile as part of your overall security posture. Let's discuss those features and how to enable them.
1816

1917
## FAPI 2.0 Required Features
2018

@@ -27,14 +25,14 @@ When customizing IdentityServer for FAPI 2.0 compliance, follow the rules listed
2725
1. Distribute discovery metadata (such as the authorization endpoint) via the metadata document.
2826
2. Reject requests using the resource owner password credentials grant.
2927
3. Only support confidential clients.
30-
4. Only issue sender-constrained access tokens;
28+
4. Only issue sender-constrained access tokens.
3129
5. Use one of the following methods for sender-constrained access tokens: MTLS and DPoP.
32-
6. Authenticate clients using one of the methods of MTLS or `private_key_jwt`.
30+
6. Authenticate clients using one of the methods of mTLS or `private_key_jwt`.
3331
7. Shall not expose open redirectors.
3432
8. Only accept the issuer identifier value as a string in the `aud` claim received in client authentication assertions.
3533
9. Do not use refresh token rotation except in extraordinary circumstances.
36-
10. If using DPoP, may use the server-provided nonce mechanism.
37-
11. Issue authorization codes with a maximum lifetime of 60 seconds;
34+
10. If using DPoP, use the server-provided nonce mechanism.
35+
11. Issue authorization codes with a maximum lifetime of 60 seconds.
3836
12. If using DPoP, shall support "Authorization Code Binding to DPoP Key".
3937
13. To accommodate clock offsets, shall accept JWTs with an `iat` or `nbf` timestamp between 0 and 10 seconds in the future, but reject JWTs with an `iat` or `nbf` timestamp greater than 60 seconds in the future.
4038
14. Restrict the privileges associated with an access token to the minimum required for the particular application or use case.
@@ -43,35 +41,43 @@ Luckily, many of these rules are enabled by default and do not require any code
4341

4442
```csharp
4543
builder.Services.AddIdentityServer(opt =>
44+
{
45+
if (builder.Environment.IsProduction())
4646
{
47-
if (builder.Environment.IsProduction())
48-
{
49-
opt.KeyManagement.KeyPath = "/tmp/keys";
50-
}
51-
opt.KeyManagement.SigningAlgorithms.Add(new SigningAlgorithmOptions(SecurityAlgorithms.RsaSsaPssSha256));
52-
53-
opt.DPoP.SupportedDPoPSigningAlgorithms = [
54-
SecurityAlgorithms.RsaSsaPssSha256,
55-
SecurityAlgorithms.RsaSsaPssSha384,
56-
SecurityAlgorithms.RsaSsaPssSha512,
57-
58-
SecurityAlgorithms.EcdsaSha256,
59-
SecurityAlgorithms.EcdsaSha384,
60-
SecurityAlgorithms.EcdsaSha512
61-
];
62-
opt.AllowedJwtAlgorithms = [
63-
SecurityAlgorithms.RsaSsaPssSha256,
64-
SecurityAlgorithms.RsaSsaPssSha384,
65-
SecurityAlgorithms.RsaSsaPssSha512,
66-
67-
SecurityAlgorithms.EcdsaSha256,
68-
SecurityAlgorithms.EcdsaSha384,
69-
SecurityAlgorithms.EcdsaSha512
70-
];
71-
opt.JwtValidationClockSkew = TimeSpan.FromSeconds(10);
72-
73-
opt.Discovery.CustomEntries.Add("token_endpoint_auth_signing_alg_values_supported", new string[] { "PS256" });
74-
})
47+
opt.KeyManagement.KeyPath = "/tmp/keys";
48+
}
49+
opt.KeyManagement.SigningAlgorithms.Add(new SigningAlgorithmOptions(SecurityAlgorithms.RsaSsaPssSha256));
50+
51+
opt.DPoP.SupportedDPoPSigningAlgorithms = [
52+
SecurityAlgorithms.RsaSsaPssSha256,
53+
SecurityAlgorithms.RsaSsaPssSha384,
54+
SecurityAlgorithms.RsaSsaPssSha512,
55+
56+
SecurityAlgorithms.EcdsaSha256,
57+
SecurityAlgorithms.EcdsaSha384,
58+
SecurityAlgorithms.EcdsaSha512
59+
];
60+
opt.SupportedClientAssertionSigningAlgorithms = [
61+
SecurityAlgorithms.RsaSsaPssSha256,
62+
SecurityAlgorithms.RsaSsaPssSha384,
63+
SecurityAlgorithms.RsaSsaPssSha512,
64+
65+
SecurityAlgorithms.EcdsaSha256,
66+
SecurityAlgorithms.EcdsaSha384,
67+
SecurityAlgorithms.EcdsaSha512
68+
];
69+
opt.SupportedRequestObjectSigningAlgorithms = [
70+
SecurityAlgorithms.RsaSsaPssSha256,
71+
SecurityAlgorithms.RsaSsaPssSha384,
72+
SecurityAlgorithms.RsaSsaPssSha512,
73+
74+
SecurityAlgorithms.EcdsaSha256,
75+
SecurityAlgorithms.EcdsaSha384,
76+
SecurityAlgorithms.EcdsaSha512
77+
];
78+
opt.JwtValidationClockSkew = TimeSpan.FromSeconds(10);
79+
80+
})
7581
```
7682

7783
The general configuration for IdentityServer includes two notable changes from what you may see in a typical authorization server implementation.
@@ -150,7 +156,7 @@ Let's review the four elements that turn a client into a FAPI 2.0-compliant clie
150156
3. Enable DPoP security for the client.
151157
4. Enable Pushed Authorization Requests
152158

153-
That's it. You now have a FAPI 2.0-compliant client. Next, let's look at
159+
That's it. You now have a FAPI 2.0-compliant client.
154160

155161
Now that our authorization server's client configuration is FAPI 2.0 compliant, we'll need our clients to comply with the requirements.
156162

@@ -186,4 +192,4 @@ You are now FAPI 2.0 compliant and ready to secure your high-value assets with D
186192

187193
## Private Key JWT vs. MTLS
188194

189-
While the FAPI 2.0 allows for choice in securing communication between the authorization server and clients, we recommend that developers implementing FAPI 2.0 start with private key JWTs before choosing MTLS. Both are supported with Duende IdentityServer, but implementing MTLS is relatively challenging to maintain in a production environment. You are responsible for your deployment and production environments, so you are ultimately best suited to decide which option to move forward with.
195+
While the FAPI 2.0 allows for choice in securing communication between the authorization server and clients, we recommend that developers implementing FAPI 2.0 start with private key JWTs before choosing mTLS. Both are supported with Duende IdentityServer, but [implementing mTLS](/identityserver/tokens/client-authentication.md#mutual-tls-client-certificates) is relatively challenging to maintain in a production environment. You are responsible for your deployment and production environments, so you are ultimately best suited to decide which option to move forward with.

0 commit comments

Comments
 (0)