-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
aspnetcore/release-notes/aspnetcore-9/includes/httpsysextendedauth.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### Configure HTTP.sys extended authentication flags | ||
|
||
You can now configure the [`HTTP_AUTH_EX_FLAG_ENABLE_KERBEROS_CREDENTIAL_CACHING`](/windows/win32/api/http/ns-http-http_server_authentication_info) and [`HTTP_AUTH_EX_FLAG_CAPTURE_CREDENTIAL`](/windows/win32/api/http/ns-http-http_server_authentication_info) HTTP.sys flags by using the new `EnableKerberosCredentialCaching` and `CaptureCredentials` properties on the HTTP.sys <xref:Microsoft.AspNetCore.Server.HttpSys.AuthenticationManager> to optimize how Windows authentication is handled. For example: | ||
|
||
```csharp | ||
webBuilder.UseHttpSys(options => | ||
{ | ||
options.Authentication.Schemes = AuthenticationSchemes.Negotiate; | ||
options.Authentication.EnableKerberosCredentialCaching = true; | ||
options.Authentication.CaptureCredentials = true; | ||
}); | ||
``` |
25 changes: 25 additions & 0 deletions
25
aspnetcore/release-notes/aspnetcore-9/includes/oidccustomparms.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
### OIDC and OAuth Parameter Customization | ||
|
||
The OAuth and OIDC authentication handlers now have an `AdditionalAuthorizationParameters` option to make it easier to customize authorization message parameters that are usually included as part of the redirect query string. In .NET 8 and earlier, this requires a custom <xref:Microsoft.AspNetCore.Authentication.WsFederation.WsFederationEvents.OnRedirectToIdentityProvider> callback or overridden <xref:Microsoft.AspNetCore.Authentication.OAuth.OAuthHandler%601.BuildChallengeUrl%2A> method in a custom handler. Here's an example of .NET 8 code: | ||
|
||
```csharp | ||
builder.Services.AddAuthentication().AddOpenIdConnect(options => | ||
{ | ||
options.Events.OnRedirectToIdentityProvider = context => | ||
{ | ||
context.ProtocolMessage.SetParameter("prompt", "login"); | ||
context.ProtocolMessage.SetParameter("audience", "https://api.example.com"); | ||
return Task.CompletedTask; | ||
}; | ||
}); | ||
``` | ||
|
||
The preceding example can now be simplified to the following code: | ||
|
||
```csharp | ||
builder.Services.AddAuthentication().AddOpenIdConnect(options => | ||
{ | ||
options.AdditionalAuthorizationParameters.Add("prompt", "login"); | ||
options.AdditionalAuthorizationParameters.Add("audience", "https://api.example.com"); | ||
}); | ||
``` |