Skip to content

Commit a44422a

Browse files
authored
Merge pull request #803 from DuendeSoftware/wca/779-client-auth-secret-jwt
Updated the upgrade to 7.3 docs with a breaking change concerning client_secret_jwt
2 parents ea57582 + 17bb96f commit a44422a

File tree

2 files changed

+68
-11
lines changed

2 files changed

+68
-11
lines changed

src/content/docs/identityserver/tokens/client-authentication.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ The following secret validators are part of Duende IdentityServer:
118118

119119
## Shared Secrets
120120

121-
Shared secrets is by far the most common technique for authenticating clients.
121+
Using shared secrets is by far the most common technique for authenticating clients.
122122

123-
From a security point of view they have some shortcomings
123+
From a security point of view, they have some shortcomings:
124124

125125
* the shared secrets must be transmitted over the network during authentication
126126
* they should not be persisted in clear text to reduce the risk of leaking them
@@ -152,7 +152,7 @@ var compromisedSecret = new Secret("just for demos, not prod!".Sha256());
152152

153153
### Authentication Using A Shared Secret
154154

155-
You can either send the client id/secret combination as part of the POST body::
155+
You can either send the client id/secret combination as part of the POST body:
156156

157157
```http request
158158
POST /connect/token
@@ -167,7 +167,7 @@ Content-type: application/x-www-form-urlencoded
167167
redirect_uri=https://myapp.com/callback
168168
```
169169

170-
...or as a basic authentication header::
170+
...or as a basic authentication header:
171171

172172
```http request
173173
POST /connect/token
@@ -209,7 +209,7 @@ The OpenID Connect specification recommends a client authentication method based
209209
instead of transmitting the shared secret over the network, the client creates a JWT and signs it with its private key.
210210
Your IdentityServer only needs to store the corresponding key to be able to validate the signature.
211211

212-
The technique is described [here](https://openid.net/specs/openid-connect-core-1_0.html#clientauthentication) and is
212+
The technique is described [here](https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication) and is
213213
based on the OAuth JWT assertion specification [(RFC 7523)](https://tools.ietf.org/html/rfc7523).
214214

215215
### Setting Up A Private Key JWT Secret
@@ -230,7 +230,7 @@ var client = new Client
230230
Type = IdentityServerConstants.SecretTypes.X509CertificateBase64,
231231

232232
Value = "MIID...xBXQ="
233-
}
233+
},
234234
new Secret
235235
{
236236
// JWK formatted RSA key
@@ -327,15 +327,14 @@ static async Task<TokenResponse> RequestTokenAsync(SigningCredentials credential
327327
}
328328
```
329329

330-
See [here](/identityserver/samples/basics#jwt-based-client-authentication) for a sample for using JWT-based
331-
authentication.
330+
See [here](/identityserver/samples/basics#jwt-based-client-authentication) for a sample for using JWT-based authentication.
332331

333332
### Using ASP.NET Core
334333

335334
The OpenID Connect authentication handler in ASP.NET Core allows for replacing a static client secret with a dynamically
336335
created client assertion.
337336

338-
This is accomplished by handling the various events on the handler. We recommend to encapsulate the event handler in a
337+
You can achieve this by handling the various events on the handler. We recommend encapsulating the event handler in a
339338
separate type. This makes it easier to consume services from DI:
340339

341340
```csharp
@@ -384,7 +383,7 @@ JWT-based authentication (and signed authorize requests) in ASP.NET Core.
384383

385384
## Strict Audience Validation
386385

387-
Private key JWT have a theoretical vulnerability where a Relying Party trusting multiple
386+
Private key JWTs have a theoretical vulnerability where a Relying Party trusting multiple
388387
OpenID Providers could be attacked if one of the OpenID Providers is malicious or compromised.
389388

390389
The attack relies on the OpenID Provider setting the audience value of the authentication JWT

src/content/docs/identityserver/upgrades/v7_2-to-v7_3.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This upgrade guide covers upgrading from Duende IdentityServer v7.2 to v7.3 ([re
99

1010
IdentityServer 7.3.0 is a significant release that includes:
1111

12-
- [FAPI 2.0 Security Profile](https://openid.net/specs/fapi-security-profile-2_0-final.html) certification
12+
- [FAPI 2.0 Security Profile][1] certification
1313
- JWT Response from the introspection endpoint ([RFC 9701](https://www.rfc-editor.org/rfc/rfc9701.html))
1414
- Diagnostic data
1515
- Removal of the experimental label from OpenTelemetry metrics
@@ -63,6 +63,64 @@ https://github.com/DuendeSoftware/products/pull/1796
6363
Several [OpenTelemetry metrics](/identityserver/diagnostics/otel.md#detailed-metrics) previously created by the meter named
6464
"Duende.IdentityServer.Experimental" have been moved to the "Duende.IdentityServer" meter.
6565

66+
#### Default Supported Signing Algorithms Have Changed For Client Assertions And Request Objects
67+
68+
To support the [FAPI 2.0 Security Profile][1], we've added new options to configure the supported signing algorithms for
69+
client assertions and request objects, and only included asymmetric algorithms by default. Before this release, all
70+
signing algorithms were supported, including the symmetric algorithms `HS256`, `HS384`, and `HS512`.
71+
72+
If you're using symmetric keys to sign client assertions or request objects, you can restore the previous behavior by adding the
73+
following code to your IdentityServer configuration:
74+
75+
```csharp title="Program.cs" {4,18-20,24,38-40}
76+
builder.Services.AddIdentityServer(options =>
77+
{
78+
// To re-enable symmetric algorithms for signing client assertions:
79+
options.SupportedClientAssertionSigningAlgorithms =
80+
[
81+
SecurityAlgorithms.RsaSha256,
82+
SecurityAlgorithms.RsaSha384,
83+
SecurityAlgorithms.RsaSha512,
84+
85+
SecurityAlgorithms.RsaSsaPssSha256,
86+
SecurityAlgorithms.RsaSsaPssSha384,
87+
SecurityAlgorithms.RsaSsaPssSha512,
88+
89+
SecurityAlgorithms.EcdsaSha256,
90+
SecurityAlgorithms.EcdsaSha384,
91+
SecurityAlgorithms.EcdsaSha512,
92+
93+
SecurityAlgorithms.HmacSha256,
94+
SecurityAlgorithms.HmacSha384,
95+
SecurityAlgorithms.HmacSha512
96+
];
97+
98+
// To re-enable symmetric algorithms for signing request objects:
99+
options.SupportedRequestObjectSigningAlgorithms =
100+
[
101+
SecurityAlgorithms.RsaSha256,
102+
SecurityAlgorithms.RsaSha384,
103+
SecurityAlgorithms.RsaSha512,
104+
105+
SecurityAlgorithms.RsaSsaPssSha256,
106+
SecurityAlgorithms.RsaSsaPssSha384,
107+
SecurityAlgorithms.RsaSsaPssSha512,
108+
109+
SecurityAlgorithms.EcdsaSha256,
110+
SecurityAlgorithms.EcdsaSha384,
111+
SecurityAlgorithms.EcdsaSha512,
112+
113+
SecurityAlgorithms.HmacSha256,
114+
SecurityAlgorithms.HmacSha384,
115+
SecurityAlgorithms.HmacSha512
116+
];
117+
});
118+
```
119+
120+
https://github.com/DuendeSoftware/products/pull/2077
121+
66122
## Step 3: Done!
67123

68124
That's it. Of course, at this point you can and should test that your IdentityServer is updated and working properly.
125+
126+
[1]: https://openid.net/specs/fapi-security-profile-2_0-final.html

0 commit comments

Comments
 (0)