Get JWT in YARP before making route - is that possible?

223 views Asked by At

I am currently trying to implement a proxy using YARP. I have read the documentation on HttpClient: https://microsoft.github.io/reverse-proxy/articles/http-client-config.html, but it doesn't seem that i can configure the HttpClient to use a AddClientAccessTokenHandler with a AddAccessTokenManagement. I would really like to tell YARP to pull a specific JWT before routing a request.

Is this possible with YARP? Or do i have to do something like:

app.MapGet("/", async (IHttpClientFactory httpClientFactory,
   HttpContext context, Logger<Program> logger) =>
{
    httpClientFactory.CreateClient("CallBackWithJwt");
});

Where the client configured has been setup as one normally would do in the IoC?

Or maybe using s custom transform, where I pull a JWT and the add that to the header? https://microsoft.github.io/reverse-proxy/articles/transforms.html

0

There are 0 answers