Skip to content

Commit 77ecd17

Browse files
authored
BackChannelHttpClient config example (DuendeArchive#163)
1 parent f09676f commit 77ecd17

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,20 @@ services.AddAuthentication(OAuth2IntrospectionDefaults.AuthenticationScheme)
1616
options.ClientSecret = "client_secret_for_introspection_endpoint";
1717
});
1818
```
19+
20+
## Configuring Backchannel HTTP Client
21+
22+
If configuration, such as using a proxy, is required for the HTTP client calling the Authority then it can be done by registering a named HTTP Client as follows
23+
24+
```csharp
25+
services.AddHttpClient(OAuth2IntrospectionDefaults.BackChannelHttpClientName)
26+
.AddHttpMessageHandler(() =>
27+
{
28+
//Configure client/handler for the back channel HTTP Client here
29+
return new HttpClientHandler
30+
{
31+
UseProxy = true,
32+
Proxy = new WebProxy(WebProxyUri, true)
33+
};
34+
}
35+
```

0 commit comments

Comments
 (0)