AuthenticationCookie
class AuthenticationCookie extends AuthenticationPlugin (View source)
Handles the cookie authentication method
Properties
string | $user | Username | from AuthenticationPlugin |
string | $password | Password | from AuthenticationPlugin |
protected IpAllowDeny | $ipAllowDeny | from AuthenticationPlugin | |
Template | $template | from AuthenticationPlugin |
Methods
Displays authentication form
Gets authentication credentials
Set the user and password after last checkings if required
Stores user credentials after successful login.
User is not allowed to login to MySQL -> authentication failed
Perform logout
Callback when user changes password.
Check configuration defined restrictions for authentication
Checks whether two-factor authentication is active for given user and performs it.
Stores username in a cookie.
Stores password in a cookie.
No description
No description
Details
__construct()
No description
Response|null
showLoginForm()
Displays authentication form
this function MUST exit/quit the application
bool
readCredentials()
Gets authentication credentials
this function DOES NOT check authentication - it just checks/provides authentication credentials required to connect to the MySQL server usually with $dbi->connect()
it returns false if something is missing - which usually leads to showLoginForm() which displays login form
it returns true if all seems ok which usually leads to auth_set_user()
it directly switches to showFailure() if user inactivity timeout is reached
bool
storeCredentials()
Set the user and password after last checkings if required
Response|null
rememberCredentials()
Stores user credentials after successful login.
Response
showFailure(AuthenticationFailure $failure)
User is not allowed to login to MySQL -> authentication failed
prepares error message and switches to showLoginForm() which display the error and the login form
protected void
logFailure(AuthenticationFailure $failure)
No description
void
logOut()
Perform logout
string
getLoginFormURL()
Returns URL for login form.
string
getErrorMessage(AuthenticationFailure $failure)
Returns error message for failed authentication.
void
handlePasswordChange(string $password)
Callback when user changes password.
void
setSessionAccessTime()
Store session access time in session.
Tries to workaround PHP 5 session garbage collection which looks at the session file's last modified time
Response|null
authenticate()
High level authentication interface
Gets the credentials or shows login form if necessary
void
checkRules()
Check configuration defined restrictions for authentication
Response|null
checkTwoFactor(ServerRequest $request)
Checks whether two-factor authentication is active for given user and performs it.
void
storeUsernameCookie(string $username)
Stores username in a cookie.
void
storePasswordCookie(string $password)
Stores password in a cookie.
string
cookieEncrypt(string $data, string $secret)
No description
string|null
cookieDecrypt(string $encryptedData, string $secret)
No description