5 #ifndef AUTHENTICATION_H 6 #define AUTHENTICATION_H 8 #include <Cutelyst/Plugins/Authentication/authenticationuser.h> 9 #include <Cutelyst/Plugins/authentication_export.h> 10 #include <Cutelyst/paramsmultimap.h> 11 #include <Cutelyst/plugin.h> 16 class AuthenticationStore;
17 class AuthenticationRealm;
58 class AuthenticationPrivate;
98 void addRealm(std::shared_ptr<AuthenticationRealm> realm);
103 void addRealm(std::shared_ptr<AuthenticationStore> store,
104 std::shared_ptr<AuthenticationCredential> credential,
110 [[nodiscard]] std::shared_ptr<AuthenticationRealm> realm(
QStringView name = defaultRealm)
const;
115 [[nodiscard]]
static bool 121 [[nodiscard]]
inline static bool authenticate(
Context *c,
QStringView realm = defaultRealm);
144 [[nodiscard]]
static bool userExists(
Context *c);
150 [[nodiscard]]
static bool userInRealm(
Context *c,
QStringView realmName = defaultRealm);
156 static void logout(
Context *c);
161 AuthenticationPrivate *d_ptr;
171 #endif // AUTHENTICATION_H std::shared_ptr< AuthenticationRealm > realm(QStringView name=defaultRealm) const
Main class to manage user authentication.
Abstract class to validate authentication credentials like user name and password.
Combines user store and credential validation into a named realm.
static bool authenticate(Context *c, const ParamsMultiMap &userinfo, QStringView realm=defaultRealm)
The Cutelyst namespace holds all public Cutelyst API.
Container for user data retrieved from an AuthenticationStore.
QMultiMap< QString, QString > ParamsMultiMap
Base class for Cutelyst Plugins.
The Cutelyst application.