You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: IdentityServer/v7/docs/content/tokens/authentication/jwt.md
+24
Original file line number
Diff line number
Diff line change
@@ -165,3 +165,27 @@ public class OidcEvents : OpenIdConnectEvents
165
165
166
166
The assertion service would be a helper to create the JWT as shown above in the *CreateClientToken* method.
167
167
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 in the authentication JWT.
182
+
183
+
You can enable strict audience validation using the [**StrictClientAssertionAudienceValidation**]({{< ref "/reference/options/#duendepreview0002" >}})
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" >}})
0 commit comments