Esempio n. 1
0
 public CasConfig(
     ILogger <CasConfig> logger,
     IAccessTokenFetcher accessTokenFetcher,
     IHttpClientFactory httpClientFactory
     ) : base(logger, accessTokenFetcher, httpClientFactory)
 {
 }
Esempio n. 2
0
 public Config(
     ILogger <Config> logger,
     IAccessTokenFetcher accessTokenFetcher,
     IHttpClientFactory httpClientFactory
     )
 {
     this.Logger             = logger;
     this.AccessTokenFetcher = accessTokenFetcher;
     this.HttpClient         = httpClientFactory.CreateClient("netbricks");
     this.Cache = new ConcurrentDictionary <string, object>();
 }
Esempio n. 3
0
 public Config(
     ILogger <Config> logger,
     IAccessTokenFetcher accessTokenFetcher = null,
     IHttpClientFactory httpClientFactory   = null,
     IConfigProvider configProvider         = null
     )
 {
     this.Logger             = logger;
     this.AccessTokenFetcher = accessTokenFetcher;
     if (httpClientFactory != null)
     {
         this.HttpClient = httpClientFactory.CreateClient("netbricks");
     }
     this.Cache          = new ConcurrentDictionary <string, object>();
     this.ConfigProvider = configProvider ?? new EnvVarConfigProvider();
 }
Esempio n. 4
0
 public CasAzureAd(
     ILogger <CasAzureAd> logger,
     IConfig config,
     CasTokenIssuer tokenIssuer,
     IHttpClientFactory httpClientFactory,
     IAccessTokenFetcher accessTokenFetcher,
     ICasClaimsBuilder claimsBuilder       = null,
     ICasAuthCodeReceiver authCodeReceiver = null
     ) : base(logger, tokenIssuer, claimsBuilder, authCodeReceiver)
 {
     this.ConfigManager      = new ConfigurationManager <OpenIdConnectConfiguration>($"{CasConfig.AzureAuthority}/.well-known/openid-configuration", new OpenIdConnectConfigurationRetriever());
     this.HttpClient         = httpClientFactory.CreateClient("cas");
     this.AccessTokenFetcher = accessTokenFetcher;
     this.Config             = config as CasConfig;
     if (this.Config == null)
     {
         throw new Exception("CasAzureAd: CasConfig was not found in the IServiceCollection.");
     }
 }