Skip to content

Commit

Permalink
fix(connector): remove use of base address of http client
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashilzendegen authored and gingters committed Nov 7, 2023
1 parent fbaabd4 commit eb358ea
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,20 @@ public AccessTokenManagementConfigureOptions(ILogger<AccessTokenManagementConfig
public void Configure(AccessTokenManagementOptions options)
{
var baseAddress = _relayConnectorOptions.DiscoveryDocument.AuthorizationServer;
if (!baseAddress.EndsWith('/'))
if (!baseAddress.EndsWith("/"))
{
baseAddress += '/';
baseAddress += "/";
}

var httpClient = _httpClientFactory.CreateClient(Constants.HttpClientNames.ConnectionClose);
httpClient.BaseAddress = new Uri(baseAddress);

var uri = httpClient.BaseAddress + OidcConstants.Discovery.DiscoveryEndpoint;
var uri = baseAddress + OidcConstants.Discovery.DiscoveryEndpoint;

while (!_hostApplicationLifetime.ApplicationStopping.IsCancellationRequested)
{
var configManager = new ConfigurationManager<OpenIdConnectConfiguration>(
OidcConstants.Discovery.DiscoveryEndpoint, new OpenIdConnectConfigurationRetriever(),
new HttpDocumentRetriever(httpClient) { RequireHttps = httpClient.BaseAddress?.Scheme == "https" });
var configManager = new ConfigurationManager<OpenIdConnectConfiguration>(uri,
new OpenIdConnectConfigurationRetriever(),
new HttpDocumentRetriever(httpClient) { RequireHttps = baseAddress.StartsWith("https:") });

try
{
Expand Down

0 comments on commit eb358ea

Please sign in to comment.