Wt: Wt::Auth::AbstractPasswordService Class Reference

Wt 4.10.4

Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Wt::Auth::AbstractPasswordService Class Referenceabstract

Abstract password authentication service. More...

`#include <Wt/Auth/AbstractPasswordService.h>`

Inheritance diagram for Wt::Auth::AbstractPasswordService:
[legend]

## Classes
class | AbstractStrengthValidator
| Validator for password strength. More...
class | StrengthValidatorResult
| Result returned when validating password strength. More...

## Public Member Functions
virtual | ~AbstractPasswordService ()
| Destructor.
virtual const AuthService & | baseAuth () const =0
| Returns the basic authentication service.
virtual bool | attemptThrottlingEnabled () const =0
| Returns whether password attempt throttling is enabled.
virtual AbstractStrengthValidator * | strengthValidator () const =0
| Returns a validator which checks that a password is strong enough.
virtual int | delayForNextAttempt (const User &user) const =0
| Returns the delay for this user for a next authentication attempt.
virtual PasswordResult | verifyPassword (const User &user, const WString &password) const =0
| Verifies a password for a given user.
virtual void | updatePassword (const User &user, const WString &password) const =0
| Sets a new password for the given user.

## Detailed Description

Abstract password authentication service.

This abstract class defines the interface for password authentication.

It provides methods to verify a password, to update a password, and to throttle password verification attempts.

See also
  PasswordService a default implementation

## Member Function Documentation

## ◆ delayForNextAttempt()

virtual int Wt::Auth::AbstractPasswordService::delayForNextAttempt | ( | const User & | user | ) | const
| pure virtual

Returns the delay for this user for a next authentication attempt.

If password attempt throttling is enabled, then this returns the number of seconds this user must wait for a new authentication attempt, presumably because of a number of failed attempts.

See also
  attemptThrottlingEnabled()

Implemented in Wt::Auth::PasswordService.

## ◆ updatePassword()

virtual void Wt::Auth::AbstractPasswordService::updatePassword | ( | const User & | user,
|  | const WString & | password ) const
| pure virtual

Sets a new password for the given user.

This stores a new password for the user in the database.

Implemented in Wt::Auth::PasswordService.

## ◆ verifyPassword()

virtual PasswordResult Wt::Auth::AbstractPasswordService::verifyPassword | ( | const User & | user,
|  | const WString & | password ) const
| pure virtual

Verifies a password for a given user.

The supplied password is verified against the user's credentials stored in the database. If password account throttling is enabled, it may also refuse an authentication attempt.

See also
  setVerifier(), setAttemptThrottlingEnabled()

Implemented in Wt::Auth::PasswordService.