[Breaking change]: AuthenticateAsync for remote authentication providers no longer fails if anonymous #491
Labels
7.0.0
Announcement
Breaking change
Documented
The breaking change has been published to the .NET Core docs
Description
RE: dotnet/aspnetcore#43042, dotnet/aspnetcore#43212
Remote authentication providers like OpenIdConnect, WsFederation, and OAuth have been updated to avoid unnecessary errors when there is no user information available on the request.
Version
.NET 7 RC1
Previous behavior
When AuthenticateAsync was called on a remote authentication provider and there was no current user, this call would fail with a message like
OpenIdConnect was not authenticated. Failure message: Not authenticated
.New behavior
AuthenticateAsync will now return
AuthenticateResult.NoResult()
, an anonymous identity.Type of breaking change
Reason for change
AuthenticateResult.NoResult()
.Recommended action
Code that directly invokes AuthenticateAsync should be checked to ensure it properly handles
AuthenticateResult.NoResult()
and anonymous/empty ClaimsIdentity's.Affected APIs
HttpContext.AuthenticateAsync
The text was updated successfully, but these errors were encountered: