-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-authIncludes: Authn, Authz, OAuth, OIDC, BearerIncludes: Authn, Authz, OAuth, OIDC, Bearer
Description
Describe the bug
.NET Core version: 3.0+
Nuget package: Microsoft.AspNetCore.Authentication.JwtBearer
Affected versions: 3.0.0-preview5-19227-01+
Last working version: 3.0.0-preview4-19216-03
Using JWT Bearer authentication, with the affected versions noted above, break the application by throwing an an MissingFieldException: Field not found: 'Microsoft.Net.Http.Headers.HeaderNames.WWWAuthenticate'.
To Reproduce
- Create an ASP.NET Core 3.0+ application add JWT Bearer Authentication
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(opts =>
{
opts.TokenValidationParameters = new TokenValidationParameters
{
IssuerSigningKey = Encryption.GetRsaKeyFromXml(Configuration["JWT:RsaPublicKeyXml"]),
ValidateIssuerSigningKey = true
};
});
- Add an
[Authorize]
attribute to an controller - Try accessing that route/controller => Exception gets thrown
Expected behavior
Authentication handler to be working fine as in last working version 3.0.0-preview4-19216-03
and no exception to be thrown.
Screenshots
Metadata
Metadata
Assignees
Labels
area-authIncludes: Authn, Authz, OAuth, OIDC, BearerIncludes: Authn, Authz, OAuth, OIDC, Bearer