© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
1 reply
pdr

Problem with JWT, always returns Unauthorized

Here is my code. I am using Identity and generated a JWT token. Apparently, when I view the token in the JWT viewer, it is generated as expected. However, it always returns "unauthorized" when I try to access a route with the [Authorize] annotation.
image.png
image.png
image.png
image.png
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

✅ jwt authentication always returns 401
C#CC# / help
3y ago
[Authorize] Always Returns 401 Even With Valid-Looking JWT Token
C#CC# / help
3mo ago
if statement always returns true
C#CC# / help
12mo ago
❔ ASP.NET always validates invalid JWT
C#CC# / help
3y ago