C#C
C#10mo ago
Salight

✅[Authorize] Doesn't Recognize Default Authentication Scheme?

In my API, when I use
[Authorize]
, sending a request from Postman with a valid token returns a 404 error.
However, when I explicitly set
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
, authentication works fine.

Why isn't
JwtBearerDefaults.AuthenticationScheme
recognized as the default?

Additional Info:

I am using
AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
in my configuration.
The token is valid, and my MVC client authenticates successfully.
In Postman, I send the Authorization header as
Bearer {token}
.
How can I fix this?
Was this page helpful?