Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

OpenIdConnectAuthenticationMiddleware initialization issue #128

Closed
@Desislav

Description

@Desislav

Hello,

I was looking at the OpenIdConnectAuthenticationMiddleware and i found some strange lines of code inside its constructor:

else if (!(string.IsNullOrWhiteSpace(Options.MetadataAddress) && string.IsNullOrWhiteSpace(Options.Authority)))
{
    //If the previous if statement is true how this condition can be ever satisfied??
   if (string.IsNullOrWhiteSpace(Options.MetadataAddress) && !string.IsNullOrWhiteSpace(Options.Authority))
   {
       Options.MetadataAddress = Options.Authority;
       if (!Options.MetadataAddress.EndsWith("/", StringComparison.Ordinal))
       {
             Options.MetadataAddress += "/";
       }
       Options.MetadataAddress += ".well-known/openid-configuration";
   }

   HttpClient httpClient = new HttpClient(ResolveHttpMessageHandler(Options));
   httpClient.Timeout = Options.BackchannelTimeout;
   httpClient.MaxResponseContentBufferSize = 1024 * 1024 * 10; // 10 MB
   Options.ConfigurationManager = new ConfigurationManager<OpenIdConnectConfiguration>(Options.MetadataAddress, httpClient);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions