public SimpleAuthenticationAzure(ISettings appSettings, ILoggingConsole loggingConsole) { this.loggingConsole = loggingConsole; this.settings = appSettings; this.authConfig = settings.GetAuthenticationConfig(); }
public void should_create_with_authentication_properties(string provider, IAuthenticationConfig config, FileConfiguration fileConfig) { var reRouteOptions = new ReRouteOptionsBuilder() .WithIsAuthenticated(true) .Build(); var authenticationOptions = new AuthenticationOptionsBuilder() .WithProvider(provider) .WithAllowedScopes(new List <string>()) .WithConfig(config) .Build(); var expected = new List <ReRoute> { new ReRouteBuilder() .WithDownstreamPathTemplate("/products/{productId}") .WithUpstreamPathTemplate("/api/products/{productId}") .WithUpstreamHttpMethod(new List <string> { "Get" }) .WithAuthenticationOptions(authenticationOptions) .Build() }; this.Given(x => x.GivenTheConfigIs(fileConfig)) .And(x => x.GivenTheConfigIsValid()) .And(x => x.GivenTheFollowingOptionsAreReturned(reRouteOptions)) .And(x => x.GivenTheAuthOptionsCreatorReturns(authenticationOptions)) .And(x => x.GivenTheLoadBalancerFactoryReturns()) .When(x => x.WhenICreateTheConfig()) .Then(x => x.ThenTheReRoutesAre(expected)) .And(x => x.ThenTheAuthenticationOptionsAre(provider, expected)) .And(x => x.ThenTheAuthOptionsCreatorIsCalledCorrectly()) .BDDfy(); }
public Settings(IAuthenticationConfig authConfig, ILoggingConsole loggingConsole) { this.authConfig = authConfig; this.loggingConsole = loggingConsole; this.appSettings = "appsettings.json"; }
public static string GetAadAuthority(this IAuthenticationConfig authenticationConfig) { return(authenticationConfig.AadAuthority + authenticationConfig.Tenant); }
public AuthenticationOptions(string provider, List <string> allowedScopes, IAuthenticationConfig config) { Provider = provider; AllowedScopes = allowedScopes; Config = config; }
public AuthenticationOptionsBuilder WithConfig(IAuthenticationConfig config) { _identityServerConfig = config; return(this); }