© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•12mo ago•
3 replies
Salight

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

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

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

Additional Info:

I am using
AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
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}
Bearer {token}
.
How can I fix this?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

the Authorize attribute doesn't work unless you explicitly define the authentication scheme in it
C#CC# / help
14mo ago
❔ Authentication scheme name
C#CC# / help
4y ago
❔ Authorize attribute automatically triggering oauth scheme
C#CC# / help
4y ago
❔ VScode doesn't recognize C# files
C#CC# / help
3y ago