示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthenticationFlow"/> class.
 /// </summary>
 /// <param name="httpContextAccessor">The context accessor.</param>
 /// <param name="jwtCrytpoProvider">The crypto provider.</param>
 /// <param name="userManager">The user manager.</param>
 /// <param name="dbContext">The database context.</param>
 /// <param name="rngGenerator">The random generator.</param>
 /// <param name="moment">The current moment provider.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public AuthenticationFlow(
     IHttpContextAccessor httpContextAccessor,
     IJwtCryptoProvider jwtCrytpoProvider,
     UserManager <AppUser> userManager,
     FvectContext dbContext,
     ISecureRandomGenerator rngGenerator,
     IMoment moment,
     IOptionsMonitor <BackendOptions> options,
     ILogger <AuthenticationFlow> logger)
 {
     this.httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
     this.jwtCrytpoProvider   = jwtCrytpoProvider ?? throw new ArgumentNullException(nameof(jwtCrytpoProvider));
     this.userManager         = userManager ?? throw new ArgumentNullException(nameof(userManager));
     this.dbContext           = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     this.rngGenerator        = rngGenerator ?? throw new ArgumentNullException(nameof(rngGenerator));
     this.moment  = moment ?? throw new ArgumentNullException(nameof(moment));
     this.options = options ?? throw new ArgumentNullException(nameof(options));
     this.logger  = logger ?? throw new ArgumentNullException(nameof(logger));
 }
示例#2
0
 /// <summary>
 /// Creates a <see cref="SigningCredentials"/> from this <see cref="IJwtCryptoProvider"/>.
 /// </summary>
 /// <param name="jwtCryptoProvider">
 /// The target <see cref="IJwtCryptoProvider"/>.
 /// </param>
 /// <returns>
 /// The created <see cref="SigningCredentials"/>.
 /// </returns>
 public static SigningCredentials CreateSigningCredentials(
     this IJwtCryptoProvider jwtCryptoProvider) =>