Ejemplo n.º 1
0
 //we allow setting recaptcha service later, at web app config time
 public RecaptchaService(RecaptchaSettings settings)
 {
     Util.Check(settings != null, "Recaptcha settings may not be null.");
       Util.Check(!string.IsNullOrEmpty(settings.SiteSecret), "reCaptcha not configured: SiteSecret may not be empty.");
       Util.Check(!string.IsNullOrEmpty(settings.SiteKey), "reCaptcha not configured: SiteKey may not be empty.");
       _settings = settings;
       if (_settings.Options.IsSet(RecaptchaOptions.UseSecureToken)) {
     _encryptionKeyIv = RecaptchaUtil.GetEncryptionKey(_settings.SiteSecret);
       }
 }
Ejemplo n.º 2
0
 //we allow setting recaptcha service later, at web app config time
 public RecaptchaService(RecaptchaSettings settings)
 {
     Util.Check(settings != null, "Recaptcha settings may not be null.");
     Util.Check(!string.IsNullOrEmpty(settings.SiteSecret), "reCaptcha not configured: SiteSecret may not be empty.");
     Util.Check(!string.IsNullOrEmpty(settings.SiteKey), "reCaptcha not configured: SiteKey may not be empty.");
     _settings = settings;
     if (_settings.Options.IsSet(RecaptchaOptions.UseSecureToken))
     {
         _encryptionKeyIv = RecaptchaUtil.GetEncryptionKey(_settings.SiteSecret);
     }
 } //constructor
Ejemplo n.º 3
0
 public LoginModuleSettings(
     LoginModuleOptions options = LoginModuleOptions.Default,
     string encryptionChannelName = null, //uses default encryption channel if name is null
     TimeSpan? passwordExpirationPeriod = null,
     RecaptchaSettings recaptcha = null,
     IPasswordHasher passwordHasher = null,
     int bcryptWorkFactor = 10)
 {
     Options = options;
       EncryptionChannelName = encryptionChannelName;
       PasswordExpirationPeriod = passwordExpirationPeriod;
       Recaptcha = recaptcha;
       PasswordHasher = passwordHasher ?? new BCryptPasswordHasher(bcryptWorkFactor);
 }