Wt  4.11.1
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 AuthServicebaseAuth () const =0
 Returns the basic authentication service.
 
virtual bool attemptThrottlingEnabled () const =0
 Returns whether password attempt throttling is enabled.
 
virtual AuthThrottlepasswordThrottle () const =0
 Returns the class instance managing the delaying. More...
 
virtual AbstractStrengthValidatorstrengthValidator () 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. More...
 
virtual PasswordResult verifyPassword (const User &user, const WString &password) const =0
 Verifies a password for a given user. More...
 
virtual void updatePassword (const User &user, const WString &password) const =0
 Sets a new password for the given user. More...
 

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.

The implementation of this functionality is managed by AuthThrottle.

See also
attemptThrottlingEnabled()

Implemented in Wt::Auth::PasswordService.

◆ passwordThrottle()

virtual AuthThrottle* Wt::Auth::AbstractPasswordService::passwordThrottle ( ) const
pure virtual

Returns the class instance managing the delaying.

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.