YARP: how to supply default credentials in a proxied request? #1886
-
Hi, I first posted this on Stack Overflow but I thought it might be good to take it straight to the source as well. Quoting from SO: Per #166 (comment) it is possible to authenticate using the default network credentials cache when a server forwards a request through YARP. (That is, it is possible to authenticate using credentials stored on the server; a user logging in through a proxy is confirmed not to be supported.) But how to actually configure this? The docs suggest that I can add a "WebProxy" block to my network configuration file, to which I can add a "UseDefaultCredentials" parameter: "MyCluster": {
"Destinations": {
"mydest": {
"Address": "https://example.com",
"UseDefaultCredentials": "true"
}
},
"HttpClient": {
"WebProxy": {
"Address": "??? what goes here?",
"UseDefaultCredentials": "true"
}
}
}, But the question is in the code: what exactly is the address supposed to be for the outgoing web proxy? Is this separate from the URLs in the destinations section? What if there is more than one destination? I have tried:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
The HttpClient.WebProxy is not for this scenario, it is for when using a forward proxy that you need to authenticate with, and will not affect the authentication between YARP and the destination server. You probably need to be looking at Configuring the client and then setting a credential something like this. |
Beta Was this translation helpful? Give feedback.
The HttpClient.WebProxy is not for this scenario, it is for when using a forward proxy that you need to authenticate with, and will not affect the authentication between YARP and the destination server.
You probably need to be looking at Configuring the client and then setting a credential something like this.