/// <summary> /// Initializes a new instance of the <see cref="HashAuthenticationModule" /> class. /// </summary> /// <param name="fetcher">The fetcher.</param> public HashAuthenticationModule(IUserFetcher fetcher) { if (fetcher == null) throw new ArgumentNullException("fetcher"); _fetcher = fetcher; PrincipalFactory = new GenericPrincipalFactory(fetcher); _authenticationMessageFactory = new AuthenticationMessageFactory(); }
/// <summary> /// Initializes a new instance of the <see cref="HashAuthenticationModule" /> class. /// </summary> /// <param name="fetcher">The fetcher.</param> public HashAuthenticationModule(IUserFetcher fetcher) { if (fetcher == null) { throw new ArgumentNullException("fetcher"); } _fetcher = fetcher; PrincipalFactory = new GenericPrincipalFactory(fetcher); _authenticationMessageFactory = new AuthenticationMessageFactory(); }
/// <summary> /// Used to configure how passwords are being hashed and which messages should be used when transfering authentication /// information /// over the network. /// </summary> /// <param name="hasher">Password hasher, the dault one is <see cref="PasswordHasherRfc2898" />.</param> /// <param name="messageFactory">Message factory, the default on is <see cref="AuthenticationMessageFactory" />.</param> public void ConfigureAuthentication(IPasswordHasher hasher, IAuthenticationMessageFactory messageFactory) { if (hasher == null) { throw new ArgumentNullException("hasher"); } if (messageFactory == null) { throw new ArgumentNullException("messageFactory"); } _authenticationMessageFactory = messageFactory; _passwordHasher = hasher; }
/// <summary> /// Used to configure how passwords are being hashed and which messages should be used when transfering authentication /// information /// over the network. /// </summary> /// <param name="hasher">Password hasher, the dault one is <see cref="PasswordHasherRfc2898" />.</param> /// <param name="messageFactory">Message factory, the default on is <see cref="AuthenticationMessageFactory" />.</param> public void ConfigureAuthentication(IPasswordHasher hasher, IAuthenticationMessageFactory messageFactory) { if (hasher == null) throw new ArgumentNullException("hasher"); if (messageFactory == null) throw new ArgumentNullException("messageFactory"); _authenticationMessageFactory = messageFactory; _passwordHasher = hasher; }