![]() |
cutelyst 5.1.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
|
Abstract class to retrieve user data from a store. More...
#include <Cutelyst/Plugins/Authentication/authenticationstore.h>
Public Member Functions | |
| AuthenticationStore () | |
| virtual | ~AuthenticationStore () |
| virtual AuthenticationUser | autoCreateUser (Context *c, const ParamsMultiMap &userinfo) const |
| virtual AuthenticationUser | autoUpdateUser (Context *c, const ParamsMultiMap &userinfo) const |
| virtual bool | canAutoCreateUser () const |
| virtual bool | canAutoUpdateUser () const |
| virtual AuthenticationUser | findUser (Context *c, const ParamsMultiMap &userinfo)=0 |
| virtual QVariant | forSession (Context *c, const AuthenticationUser &user) |
| virtual AuthenticationUser | fromSession (Context *c, const QVariant &frozenUser) |
| virtual bool | validatePassword (Context *c, const AuthenticationUser &user, const QString &password) const |
Use this class to create your own user store. Reimplement the pure virtual function findUser() to retrieve user data from a storage like a file or a database.
For an example implementation see Authentication overview.
Definition at line 21 of file authenticationstore.h.
| AuthenticationStore::AuthenticationStore | ( | ) |
Constructs a new AuthenticationStore object.
Definition at line 25 of file authenticationstore.cpp.
|
virtual |
Destroys the AuthenticationStore object.
Definition at line 29 of file authenticationstore.cpp.
|
virtual |
Reimplement this if your store supports automatic user creation.
Definition at line 38 of file authenticationstore.cpp.
|
virtual |
Reimplement this if your store supports automatic user update.
Definition at line 51 of file authenticationstore.cpp.
|
virtual |
Reimplement this if your store supports automatic user creation.
Definition at line 33 of file authenticationstore.cpp.
|
virtual |
Reimplement this if your store supports automatic user update.
Definition at line 46 of file authenticationstore.cpp.
|
pure virtual |
Retrieve the user that matches the userinfo.
Implemented in Cutelyst::StoreHtpasswd, Cutelyst::StoreMinimal, and Cutelyst::StoreLDAP.
|
virtual |
Reimplement this so that you return a serializable value that can be used to identify the user. The default implementation just returns the user.
Reimplemented in Cutelyst::StoreHtpasswd, Cutelyst::StoreMinimal, and Cutelyst::StoreLDAP.
Definition at line 59 of file authenticationstore.cpp.
References QVariant::fromValue().
|
virtual |
Reimplement this so that you return a User that was stored in the session.
The default implementation just returns the user.
Reimplemented in Cutelyst::StoreHtpasswd, Cutelyst::StoreMinimal, and Cutelyst::StoreLDAP.
Definition at line 65 of file authenticationstore.cpp.
References QVariant::value().
|
virtual |
Validates the given password for the user. Default implementation returns false. Stores that support password validation (e.g., LDAP) should override this.
Reimplemented in Cutelyst::StoreLDAP.
Definition at line 13 of file authenticationstore.cpp.