-
|
Hi, We are using the proxy in front of 3rd party services witch dose not support OIDC. Below I have a configuration example which I don't know how to extend it in order to handle 3rd party service redirects. Everything is working fine until the app is doing a redirect. e.g.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You have two choices to address link generation issues like this: A) Flow the value "/app1" to the destination as a request header "x-forwarded-pathbase" or similar. This could be added with a header transform. The destination can consume this value and use it when generating links and redirects. There are some examples of this from the receiving end here: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-3.1#deal-with-path-base-and-proxies-that-change-the-request-path B) Re-writing links and redirects in the response using a response header transform. We haven't written a transform for this yet, we'd need to write one that derives from ResponseHeaderTransform. #60 tracks how we'd integrate custom transforms with config, at the moment there isn't a good way to add your own custom transform to a route. A is recommended as both a short term (you should be able to use it now) and long term solution since creating the correct links and redirects the first time is much less error prone than trying to rewrite them later. B should only be used if you can't modify the destination app to generate accurate links/redirects. Note B would still only be able to handle redirects, not links in the body. Rewriting the response body is a much harder problem, and not one YARP intends to tackle any time soon. |
Beta Was this translation helpful? Give feedback.
You have two choices to address link generation issues like this:
A) Flow the value "/app1" to the destination as a request header "x-forwarded-pathbase" or similar. This could be added with a header transform. The destination can consume this value and use it when generating links and redirects. There are some examples of this from the receiving end here: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-3.1#deal-with-path-base-and-proxies-that-change-the-request-path
B) Re-writing links and redirects in the response using a response header transform. We haven't written a transform for this yet, we'd need to write one that derives from Respo…