/// <summary>
 /// Initializes a new instance of the <see cref="DeviceCodeValidator"/> class.
 /// </summary>
 /// <param name="devices">The devices.</param>
 /// <param name="profile">The profile.</param>
 /// <param name="throttlingService">The throttling service.</param>
 /// <param name="systemClock">The system clock.</param>
 /// <param name="logger">The logger.</param>
 public DeviceCodeValidator(
     IDeviceFlowCodeService devices,
     IProfileService profile,
     IDeviceFlowThrottlingService throttlingService,
     ISystemClock systemClock,
     ILogger <DeviceCodeValidator> logger)
 {
     _devices           = devices;
     _profile           = profile;
     _throttlingService = throttlingService;
     _systemClock       = systemClock;
     _logger            = logger;
 }
Exemplo n.º 2
0
        public static IDeviceCodeValidator CreateDeviceCodeValidator(
            IDeviceFlowCodeService service,
            IProfileService profile = null,
            IDeviceFlowThrottlingService throttlingService = null,
            ISystemClock clock = null)
        {
            profile           = profile ?? new TestProfileService();
            throttlingService = throttlingService ?? new TestDeviceFlowThrottlingService();
            clock             = clock ?? new StubClock();

            var validator = new DeviceCodeValidator(service, profile, throttlingService, clock, TestLogger.Create <DeviceCodeValidator>());

            return(validator);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DeviceCodeValidator"/> class.
 /// </summary>
 /// <param name="devices">The devices.</param>
 /// <param name="profile">The profile.</param>
 /// <param name="throttlingService">The throttling service.</param>
 /// <param name="systemClock">The system clock.</param>
 /// <param name="logger">The logger.</param>
 public MyDeviceCodeValidator(
     IScopedContext <TenantRequestContext> scopedTenantRequestContext,
     IScopedOptionalClaims scopedOptionalClaims,
     IDeviceFlowCodeService devices,
     IProfileService profile,
     IDeviceFlowThrottlingService throttlingService,
     ISystemClock systemClock,
     ILogger <MyDeviceCodeValidator> logger)
 {
     _scopedTenantRequestContext = scopedTenantRequestContext;
     _scopedOptionalClaims       = scopedOptionalClaims;
     _devices           = devices;
     _profile           = profile;
     _throttlingService = throttlingService;
     _systemClock       = systemClock;
     _logger            = logger;
 }