Skip to content

Commit ec9b887

Browse files
authored
Merge pull request #611 from DuendeSoftware/mb/experimental
Add docs about preview/experimental features
2 parents 89385c1 + 57a3f2f commit ec9b887

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

FOSS/content/AccessTokenManagement/Advanced/client_assertions.md

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ public class ClientAssertionService : IClientAssertionService
4040
{ JwtClaimTypes.JwtId, Guid.NewGuid().ToString() },
4141
{ JwtClaimTypes.Subject, options.ClientId! },
4242
{ JwtClaimTypes.IssuedAt, DateTime.UtcNow.ToEpochTime() }
43+
},
44+
45+
AdditionalHeaderClaims = new Dictionary<string, object>
46+
{
47+
{ JwtClaimTypes.TokenType, "client-authentication+jwt" }
4348
}
4449
};
4550

IdentityServer/v7/docs/content/reference/options.md

+33
Original file line numberDiff line numberDiff line change
@@ -723,3 +723,36 @@ Demonstration of Proof-of-Possession settings. Available on the *DPoP* property
723723
* ***Lifetime***
724724

725725
Controls the lifetime of pushed authorization requests. The pushed authorization request's lifetime begins when the request to the PAR endpoint is received, and is validated until the authorize endpoint returns a response to the client application. Note that user interaction, such as entering credentials or granting consent, may need to occur before the authorize endpoint can do so. Setting the lifetime too low will likely cause login failures for interactive users, if pushed authorization requests expire before those users complete authentication. Some security profiles, such as the FAPI 2.0 Security Profile recommend an expiration within 10 minutes to prevent attackers from pre-generating requests. To balance these constraints, this lifetime defaults to 10 minutes.
726+
727+
## Preview Features
728+
Preview Features settings. Available on the *Preview* property of the *IdentityServerOptions* object.
729+
730+
{{% notice note %}}
731+
Duende IdentityServer may ship preview features, which can be configured using preview options.
732+
Note that preview features can be removed and may break in future releases.
733+
{{% /notice %}}
734+
735+
#### Discovery Document Cache
736+
737+
In large deployments of Duende IdentityServer, where a lot of concurrent users attempt to
738+
consume the [discovery endpoint]({{< ref "reference/endpoints/discovery" >}}) to retrieve
739+
metadata about your IdentityServer, you can increase throughput by enabling the
740+
discovery document cache preview using the **EnableDiscoveryDocumentCache** flag.
741+
This will cache discovery document information for the duration specified in the
742+
**DiscoveryDocumentCacheDuration** option.
743+
744+
It's best to keep the cache time low if you use the `CustomEntries` element on the
745+
discovery document or implement a custom `IDiscoveryResponseGenerator`.
746+
747+
#### Strict Audience Validation
748+
749+
When using [*private key JWT*]({{< ref "/tokens/authentication/jwt" >}}),
750+
there is a theoretical vulnerability where a Relying Party trusting multiple OpenID Providers
751+
could be attacked if one of the OpenID Providers is malicious or compromised.
752+
753+
The OpenID Foundation proposed a two-part fix: strictly validate the audience and set an
754+
explicit `typ` header in the authentication JWT.
755+
756+
You can [enable strict audience validation in Duende IdentityServer]({{< ref "/tokens/authentication/jwt#strict-audience-validation" >}})
757+
using the **StrictClientAssertionAudienceValidation** flag, which strictly validates that
758+
the audience is equal to the issuer and validates the token's `typ` header.

IdentityServer/v7/docs/content/tokens/authentication/jwt.md

+24
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,27 @@ public class OidcEvents : OpenIdConnectEvents
165165

166166
The assertion service would be a helper to create the JWT as shown above in the *CreateClientToken* method.
167167
See [here]({{< ref "/samples/basics#mvc-client-with-jar-and-jwt-based-authentication" >}}) for a sample for using JWT-based authentication (and signed authorize requests) in ASP.NET Core.
168+
169+
## Strict Audience Validation
170+
171+
Private key JWT have a theoretical vulnerability where a Relying Party trusting multiple
172+
OpenID Providers could be attacked if one of the OpenID Providers is malicious or compromised.
173+
174+
The attack relies on the OpenID Provider setting the audience value of the authentication JWT
175+
to the token endpoint based on the token endpoint value found in the discovery document.
176+
The malicious Open ID Provider can attack this because it controls what the discovery document
177+
contains, and can fool the Relying Party into creating authentication JWTs for the audience of
178+
a victim OpenID Provider.
179+
180+
The OpenID Foundation proposed a two-part fix: strictly validate the audience and set an
181+
explicit `typ` header (with value `client-authentication+jwt`) in the authentication JWT.
182+
183+
You can enable strict audience validation using the [**StrictClientAssertionAudienceValidation**]({{< ref "/reference/options/#strict-audience-validation" >}})
184+
flag, which strictly validates that the audience is equal to the issuer and validates the token's
185+
`typ` header.
186+
187+
Validation behavior is determined based on the `typ` header being present.
188+
If the **StrictClientAssertionAudienceValidation** flag is not set but the token sets the `typ`
189+
to `client-authentication+jwt`, then the audience will still be validated strictly.
190+
If `typ` is not present, [default audience validation]({{< ref "/apis/aspnetcore/jwt/#adding-audience-validation" >}})
191+
is used.

0 commit comments

Comments
 (0)