コード例 #1
0
ファイル: WebAuth.cpp プロジェクト: markrey/RTAutomation
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
ファイル: BlogSession.C プロジェクト: geolffrey/blog-wt
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));
}