Validate JWT with C#

I’m looking for a C# code sample that shows how to verify a JWT that has been created with RS256.

I’m struggling to find some samples that validate using the raw signed certificate or thumbprint.

Essentially, all I need returned in my code is a verified or not.

I would suggest you to have a look at our .NET samples, e.g. WebAPI (OWIN): https://auth0.com/docs/quickstart/backend/webapi-owin/01-authorization

I would suggest you to have a look at our .NET samples, e.g. WebAPI (OWIN): https://auth0.com/docs/quickstart/backend/webapi-owin/01-authorization

As Prashant mentioned in his answer, it is best to look at the ASP.NET Backend / API quickstarts, as they show you how to use the JWT middleware which integrates properly with the ASP.NET authentication mechanisms.

However, if you simply want to validate a token in a standalone app, you can refer to this blog post I wrote: Manually validating a JWT using .NET | Jerrie Pelser's Blog

1 Like