Auth0 Home Blog Docs

Validate JWT with C#

jwt
verify

#1

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.


#2

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


#3

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


#4

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: http://www.jerriepelser.com/blog/manually-validating-rs256-jwt-dotnet/


#5