back-end icon indicating copy to clipboard operation
back-end copied to clipboard

AuthenticationScheme: Bearer was not authenticated

Open DevD4v3 opened this issue 2 years ago • 0 comments

When accessing an unprotected endpoint such as http://localhost:3978/api/gender, the following message is displayed:

dbug: DentallApp.Extensions.AuthenticationJwtBearer+CustomJwtBearerHandler[9]
      AuthenticationScheme: Bearer was not authenticated.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]

This should not be displayed because at no point is the Authorization header included in the HTTP request, i.e. the Bearer does not actually provide any access token.

This is strange behavior, as this does not impair the operation of the application. An important detail is that this message is only displayed in development mode. If we change ASPNETCORE_ENVIRONMENT to Production, the message disappears.

PD: This behavior arose from PR #136.

DevD4v3 avatar Feb 12 '23 23:02 DevD4v3