Relative Content

Tag Archive for c#.net-8.0

Unauthorized (http 401) error with .NET 8 custom token handler

In .NET 8, I’m trying to implement a custom JWT token handler. The incoming JWT is missing the aud and iss claims. This may be incompliant with the OAuth standard (not sure), but it’s something I have to deal with.
I’ve read about the breaking changes in .NET 8 concerning JWT token validation:
https://github.com/aspnet/Announcements/issues/508.
So I’m trying to implement a TokenHandler rather than a ISecurityTokenValidator.

TaskCanceledException on httprequest .net8

I have a client-side and server-side project both working on my localhost in .net 8. When i try to send a post request to my server-side i get error System.Threading.Tasks.TaskCanceledException I wrote many more controllers until i get this error, those requests were working fine but this one… Also when i try to send the same request on Postman it works fine. Here is my server-side code:

Issue with Entity Framework query not working when combined into one statement but works when split into two separate statements in .NET 8

// This query doesn’t work as expected List<Cloudadminauthlist> authOnlylist = _masterReadDb.Cloudadminauthlist .Where(x => x.Authcode != null && authcode.Contains(x.Authcode)) .ToList(); // These two queries work fine List<Cloudadminauthlist> authAlllist = _masterReadDb.Cloudadminauthlist.ToList(); List<Cloudadminauthlist> authlist = authAlllist .Where(x => x.Authcode != null && authcode.Contains(x.Authcode)) .ToList(); I’m encountering a peculiar issue with my Entity Framework (EF) query in .NET 8. […]