Member-only story
ASP.NET multiple JWT token providers #Auth0 #Custom
This is a more short tip than regular story.
You can check this story as video as well.
Background
I am working on replacement for custom proxy system. Purpose of this Proxy is to expose some private APIs endpoints to the internet.
I decided two create a new .NET8+ proxy system. I tried to use Ocelot or YARP as a core component. Finally I decided to chose YARP because of Microsoft support and better body transformation possibilities.
The last step is implementation of Authentication and Authorization. The requirement is to use JWT token that can be obtained from Auth0 (OAuth2 server) or custom internal auth system.
Implementation
All code is in the Program.cs file (for simplicity). This code as simples as possible. You have to add additional validations.