Esempio n. 1
0
 /// <summary>
 /// Creates a new instance of <see cref="OtpAuthenticateExtensionGrantValidator"/>.
 /// </summary>
 /// <param name="validator">Validates an access token.</param>
 /// <param name="userManager">Provides the APIs for managing user in a persistence store.</param>
 /// <param name="totpOptions">Configuration used in <see cref="System.Security.Rfc6238AuthenticationService"/> service.</param>
 /// <param name="identityMessageDescriber">Provides an extensibility point for altering localizing used inside the package.</param>
 /// <param name="totpService">Used to generate, send and verify time based one time passwords.</param>
 public OtpAuthenticateExtensionGrantValidator(
     ITokenValidator validator,
     UserManager <User> userManager,
     TotpOptions totpOptions,
     IdentityMessageDescriber identityMessageDescriber,
     ITotpService totpService
     )
 {
     _tokenValidator               = validator ?? throw new ArgumentNullException(nameof(validator));
     _userManager                  = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _identityMessageDescriber     = identityMessageDescriber ?? throw new ArgumentNullException(nameof(identityMessageDescriber));
     _totpService                  = totpService ?? throw new ArgumentNullException(nameof(totpService));
     _rfc6238AuthenticationService = new Rfc6238AuthenticationService(totpOptions.Timestep, totpOptions.CodeLength);
 }
 /// <summary>
 /// Creates a new instance of <see cref="ExtendedUserManager{TUser}"/>.
 /// </summary>
 /// <param name="userStore">The persistence store the manager will operate over.</param>
 /// <param name="identityMessageDescriber">Provides an extensibility point for localizing messages used inside the package.</param>
 /// <param name="optionsAccessor">The accessor used to access the <see cref="IdentityOptions"/>.</param>
 /// <param name="passwordHasher">The password hashing implementation to use when saving passwords.</param>
 /// <param name="userValidators">A collection of <see cref="IUserValidator{TUser}"/> to validate users against.</param>
 /// <param name="passwordValidators">A collection of <see cref="IPasswordValidator{TUser}"/> to validate passwords against.</param>
 /// <param name="keyNormalizer">The <see cref="ILookupNormalizer"/> to use when generating index keys for users.</param>
 /// <param name="errors">The <see cref="IdentityErrorDescriber"/> used to provider error messages.</param>
 /// <param name="services">The <see cref="IServiceProvider"/> used to resolve services.</param>
 /// <param name="logger">The logger used to log messages, warnings and errors.</param>
 public ExtendedUserManager(
     IdentityErrorDescriber errors,
     IdentityMessageDescriber identityMessageDescriber,
     IEnumerable <IPasswordValidator <TUser> > passwordValidators,
     IEnumerable <IUserValidator <TUser> > userValidators,
     ILogger <ExtendedUserManager <TUser> > logger,
     ILookupNormalizer keyNormalizer,
     IOptionsSnapshot <IdentityOptions> optionsAccessor,
     IPasswordHasher <TUser> passwordHasher,
     IServiceProvider services,
     IUserStore <TUser> userStore
     ) : base(userStore, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger)
 {
     MessageDescriber = identityMessageDescriber ?? throw new ArgumentNullException(nameof(identityMessageDescriber));
 }
Esempio n. 3
0
 /// <inheritdoc/>
 public UserNameAsPasswordValidator(IConfiguration configuration, IdentityMessageDescriber messageDescriber) : base(configuration, messageDescriber)
 {
 }
Esempio n. 4
0
 /// <inheritdoc/>
 public UnicodeCharactersPasswordValidator(IdentityMessageDescriber messageDescriber, IConfiguration configuration) : base(messageDescriber, configuration)
 {
 }
Esempio n. 5
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="dbContext">The DbContext to use for the Identity framework.</param>
 /// <param name="configuration">Represents a set of key/value application configuration properties.</param>
 /// <param name="messageDescriber">Provides the various messages used throughout Indice packages.</param>
 public PreviousPasswordAwareValidator(TContext dbContext, IConfiguration configuration, IdentityMessageDescriber messageDescriber) : base(dbContext, configuration, messageDescriber)
 {
 }
Esempio n. 6
0
 /// <inheritdoc/>
 public NonCommonPasswordValidator(IEnumerable <IPasswordBlacklistProvider> providers, IdentityMessageDescriber messageDescriber) : base(providers, messageDescriber)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// Creates a new instance of <see cref="AllowedCharactersPasswordValidator{TUser}"/>.
 /// </summary>
 /// <param name="configuration">Represents a set of key/value application configuration properties.</param>
 /// <param name="messageDescriber">Provides the various messages used throughout Indice packages.</param>
 public AllowedCharactersPasswordValidator(IConfiguration configuration, IdentityMessageDescriber messageDescriber)
 {
     AllowedCharacters = configuration.GetSection($"{nameof(IdentityOptions)}:{nameof(IdentityOptions.Password)}").GetValue <string>(nameof(AllowedCharacters)) ??
                         configuration.GetSection(nameof(PasswordOptions)).GetValue <string>(nameof(AllowedCharacters));
     MessageDescriber = messageDescriber ?? throw new ArgumentNullException(nameof(messageDescriber));
 }
 /// <inheritdoc/>
 public LatinLettersOnlyPasswordValidator(IdentityMessageDescriber messageDescriber, IConfiguration configuration) : base(messageDescriber, configuration)
 {
 }