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

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

            var factor = new TotpFactor
            {
                FactorType = FactorType.TokenSoftwareTotp,
                Provider   = totpFactorOptions.Provider
            };

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