-
Is it possible to select a route based on the E.g. a request for It seems a problem will be that Authorization is predicated on routing in YARP which seems to create a catch-22. My middleware must run before routing, but it needs the authenticated identity, which is only known after routing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Nothing built in, though there are manual ways you could do it. See: Part of the problem is that the type of auth to be performed can be specified per route in aspnetcore, so auth happens after routing. Do you have auth setup so that it happens before requests and is route independent? |
Beta Was this translation helpful? Give feedback.
Nothing built in, though there are manual ways you could do it. See:
https://github.com/dotnet/yarp/blob/5e0bbb4375b1385ff6a7cafe47fb6217854656d2/samples/ReverseProxy.Direct.Sample/README.md
Or
yarp/src/ReverseProxy/Model/HttpContextFeaturesExtensions.cs
Line 49 in 5e0bbb4
Part of the problem is that the type of auth to be performed can be specified per route in aspnetcore, so auth happens after routing.
Do you have auth setup so that it happens before requests and is route independent?