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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to select a route based on the
Claims
of theHttpContext.User
?My use case is that request by one user should take use a different route than requests by another user.
E.g. a request for
/foo
by userA
should proxy tohttps://example.com/foo
and transform the request to use a client certificate. However a request for/foo
by userB
should proxy tohttps://contoso.com/foo
and use OIDC client-credentials to get a token for that call.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.
All reactions