Пример #1
0
void WebAuth::configureAuth()
{
    WebAuthService.setAuthTokensEnabled(true, "WebCookie");
    WebAuthService.setEmailVerificationEnabled(true);

    Auth::PasswordVerifier *verifier = new Auth::PasswordVerifier();
    verifier->addHashFunction(new Auth::BCryptHashFunction(7));

    WebPasswordService.setVerifier(verifier);
    WebPasswordService.setStrengthValidator(new Auth::PasswordStrengthValidator());
    WebPasswordService.setAttemptThrottlingEnabled(true);
}
Пример #2
0
void BlogSession::configureAuth()
{
  blogAuth.setAuthTokensEnabled(true, "bloglogin");

  Auth::PasswordVerifier *verifier = new Auth::PasswordVerifier();
  verifier->addHashFunction(new Auth::BCryptHashFunction(7));
#ifdef WT_WITH_SSL
  verifier->addHashFunction(new Auth::SHA1HashFunction());
#endif
#ifdef HAVE_CRYPT
  verifier->addHashFunction(new UnixCryptHashFunction());
#endif
  blogPasswords.setVerifier(verifier);
  blogPasswords.setAttemptThrottlingEnabled(true);
  blogPasswords.setStrengthValidator
    (new Auth::PasswordStrengthValidator());

  if (Auth::GoogleService::configured())
    blogOAuth.push_back(new Auth::GoogleService(blogAuth));
}
Пример #3
0
Файл: Session.C Проект: DTidd/wt
void Session::configureAuth()
{
  myAuthService.setAuthTokensEnabled(true, "hangmancookie");
  myAuthService.setEmailVerificationEnabled(true);

  Auth::PasswordVerifier *verifier = new Auth::PasswordVerifier();
  verifier->addHashFunction(new Auth::BCryptHashFunction(7));

#ifdef HAVE_CRYPT
  // We want to still support users registered in the pre - Wt::Auth
  // version of the hangman example
  verifier->addHashFunction(new UnixCryptHashFunction());
#endif

  myPasswordService.setVerifier(verifier);
  myPasswordService.setStrengthValidator(new Auth::PasswordStrengthValidator());
  myPasswordService.setAttemptThrottlingEnabled(true);

  if (Auth::GoogleService::configured())
    myOAuthServices.push_back(new Auth::GoogleService(myAuthService));
}