コード例 #1
0
 public TotpManager(ITotpGenerator totpGenerator, string secretKey, int totpTokenLifetimeInSeconds, ITotpTokenRepository totpTokenRepository)
 {
     _totpGenerator = totpGenerator ?? throw new ArgumentNullException(nameof(totpGenerator));
     _secretKey     = secretKey ?? throw new ArgumentNullException(nameof(secretKey));
     _totpTokenLifetimeInSeconds = totpTokenLifetimeInSeconds;
     _totpTokenRepository        = totpTokenRepository;
 }
コード例 #2
0
 public AccountController(UserManager <User> userManager,
                          SignInManager <User> signInManager,
                          ILogger <AccountController> logger,
                          IEmailService emailService,
                          ApplicationDbContext dbContext,
                          IConfiguration configuration,
                          RoleManager <IdentityRole> roleManager)
 {
     this.userManager   = userManager;
     this.signInManager = signInManager;
     this.logger        = logger;
     this.emailService  = emailService;
     this.dbContext     = dbContext;
     this.configuration = configuration;
     this.totpGenerator = new TotpGenerator();
     this.totpValidator = new TotpValidator(this.totpGenerator);
     this.roleManager   = roleManager;
 }
コード例 #3
0
 public TotpValidator(ITotpGenerator totpGenerator)
 {
     this.totpGenerator = totpGenerator;
 }
コード例 #4
0
 public Totp(ITotpSetupGenerator totpSetupGenerator)
 {
     _totpSetupGenerator = totpSetupGenerator;
     _totpGenerator      = new TotpGenerator();
     _totpValidator      = new TotpValidator(_totpGenerator);
 }
コード例 #5
0
 public TotpValidatorTests()
 {
     this.totpGenerator = new TotpGenerator();
     this.totpValidator = new TotpValidator(this.totpGenerator);
 }