public void ThrowsIfArgumentsAreInvalid( ITokenProviderFactory factory, IOptions <SSOSettings> options, string expected) { // Arrange/Act/Assert var ex = Assert.Throws <ArgumentNullException>(expected, () => new SSOManager(factory, options)); }
/// <summary> /// Initializes a new instance of the <see cref="FileSecurityClient"/> class. /// </summary> /// <param name="httpClient">The HTTP client to use. The caller is expected to manage this resource and it will not be disposed.</param> /// <param name="tokenProviderFactory">The Logic access token provider factory.</param> /// <param name="options">The required configuration options.</param> public FileSecurityClient( HttpClient httpClient, ITokenProviderFactory tokenProviderFactory, FileSecurityOptions options) { this.httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); this.options = options ?? throw new ArgumentNullException(nameof(options)); this.tokenProviderFactory = tokenProviderFactory ?? throw new ArgumentNullException(nameof(tokenProviderFactory)); }
internal SSOService(ITokenProviderFactory factory, SSOTargetSettings targetSettings) { settings = targetSettings.ThrowIfNull(nameof(settings)); settings.AppName.ThrowIfNullOrEmpty(nameof(settings.AppName)); settings.AuthenticationUrlTemplate.ThrowIfNullOrEmpty(nameof(settings.AuthenticationUrlTemplate)); settings.TokenProviderSettings.ThrowIfNull(nameof(settings.TokenProviderSettings)); tokenProvider = factory.Create(settings.TokenProviderSettings); }
public SSOManager(ITokenProviderFactory factory, IOptions <SSOSettings> options) { factory.ThrowIfNull(nameof(factory)); settings = options.ThrowIfNull(nameof(options)).Value; settings.ThrowIfNull(nameof(settings)); ssoServices = new Dictionary <string, SSOService>(); foreach (var app in settings.Apps) { var ssoService = new SSOService(factory, app); ssoServices.Add(app.AppName.ToLower(), ssoService); } }
public SecureWebApiConfiguration(ITokenProviderFactory tokenProviderFactory) { if (this.TokenProviderType == null) { throw new ArgumentNullException("TokenProviderType"); } try { this.TokenProvider = tokenProviderFactory.Create(this.TokenProviderType); } catch (Exception ex) { throw new Exception(String.Format("Failed to create token provider of type '{0}'", this.TokenProviderType.FullName), ex); } }
public LoginRequestHandler(ITokenProviderFactory tokenProviderFactory, IUserRepository userRepository) { _tokenFactory = tokenProviderFactory.GetTokenFactory(TokenConfiguration.TokenProvider); _userRepository = userRepository; }
public SecureWebApiAppSettingsConfiguration(ITokenProviderFactory tokenProviderFactory) : base(tokenProviderFactory) { }
/// <summary> /// Initializes a new instance of the <see cref="CprClient"/> class. /// </summary> /// <param name="httpClient">The HTTP client to use. The caller is expected to manage this resource and it will not be disposed.</param> /// <param name="tokenProviderFactory">The Logic access token provider factory.</param> /// <param name="options">The required configuration options.</param> public CprClient(HttpClient httpClient, ITokenProviderFactory tokenProviderFactory, CprOptions options) { this._httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); this._options = options ?? throw new ArgumentNullException(nameof(options)); this._tokenProviderFactory = tokenProviderFactory ?? throw new ArgumentNullException(nameof(tokenProviderFactory)); }
public AuthorizationHandler(ITokenProviderFactory tokenProviderFactory, ITokenFlowRegister tokenFlowRegister) { this.tokenProviderFactory = tokenProviderFactory; this.tokenFlowRegister = tokenFlowRegister; }