Cutelyst  1.5.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
Cutelyst::Authentication Class Reference
Inheritance diagram for Cutelyst::Authentication:
Inheritance graph
[legend]

Public Member Functions

 Authentication (Application *parent)
 
void addRealm (AuthenticationRealm *realm, const QString &name=QLatin1String(defaultRealm))
 
void addRealm (AuthenticationStore *store, AuthenticationCredential *credential, const QString &name=QLatin1String(defaultRealm))
 
AuthenticationRealmrealm (const QString &name=QLatin1String(defaultRealm)) const
 
- Public Member Functions inherited from Cutelyst::Plugin
 Plugin (Application *parent)
 
virtual bool setup (Application *app)
 

Static Public Member Functions

static bool authenticate (Context *c, const ParamsMultiMap &userinfo, const QString &realm=QLatin1String(defaultRealm))
 
static bool authenticate (Context *c, const QString &realm=QLatin1String(defaultRealm))
 
static AuthenticationUser findUser (Context *c, const ParamsMultiMap &userinfo, const QString &realm=QLatin1String(defaultRealm))
 
static void logout (Context *c)
 
static AuthenticationUser user (Context *c)
 
static bool userExists (Context *c)
 
static bool userInRealm (Context *c, const QString &realmName=QLatin1String(defaultRealm))
 

Static Public Attributes

static char * defaultRealm
 

Protected Attributes

AuthenticationPrivate * d_ptr
 

Detailed Description

Definition at line 44 of file authentication.h.

Member Function Documentation

static bool Cutelyst::Authentication::authenticate ( Context c,
const ParamsMultiMap userinfo,
const QString &  realm = QLatin1String(defaultRealm) 
)
static

Returns true if the userinfo could be validated against a realm.

Referenced by authenticate().

bool Cutelyst::Authentication::authenticate ( Context c,
const QString &  realm = QLatin1String(defaultRealm) 
)
inlinestatic

Returns true if the request information could be validated against a realm.

Definition at line 103 of file authentication.h.

References authenticate().

static void Cutelyst::Authentication::logout ( Context c)
static

Logs the user out. Deletes the currently logged in user from the Context and the session. It does not delete the session.

static AuthenticationUser Cutelyst::Authentication::user ( Context c)
static

Returns the authenticated user if any, if you only need to know if the user is authenticated (rather than retrieving it's ID) use userExists instead which is faster.

static bool Cutelyst::Authentication::userExists ( Context c)
static

Returns true if a user is logged in right now. The difference between userExists() and user() is that userExists will return true if a user is logged in, even if it has not been yet retrieved from the storage backend. If you only need to know if the user is logged in, depending on the storage mechanism this can be much more efficient. userExists() only looks into the session while user() is trying to restore the user.

static bool Cutelyst::Authentication::userInRealm ( Context c,
const QString &  realmName = QLatin1String(defaultRealm) 
)
static

Works like user_exists, except that it only returns true if a user is both logged in right now and was retrieved from the realm provided.