예제 #1
0
        /// <inheritdoc/>
        public Task <IFactor> AddFactorAsync(string userId, AddHardwareFactorOptions hardwareFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (hardwareFactorOptions == null)
            {
                throw new ArgumentNullException(nameof(hardwareFactorOptions));
            }

            if (hardwareFactorOptions.Provider == null)
            {
                throw new ArgumentNullException(nameof(hardwareFactorOptions.Provider));
            }

            var verify = new VerifyFactorRequest
            {
                PassCode = hardwareFactorOptions.PassCode
            };

            var factor = new HardwareFactor
            {
                FactorType = FactorType.TokenHardware,
                Provider   = hardwareFactorOptions.Provider,
                Verify     = verify
            };

            return(AddFactorAsync(factor, userId, cancellationToken: cancellationToken));
        }
예제 #2
0
 public Task <IFactor> AddFactorAsync(AddHardwareFactorOptions hardwareFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
 => GetClient().UserFactors.AddFactorAsync(Id, hardwareFactorOptions, cancellationToken);