Class MOXMAN_Auth_AuthManager
Inheritance | MOXMAN_Auth_AuthManager |
---|
This class handles the authentication of the remote user.
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Constructs a new authentication manager instance. | MOXMAN_Auth_AuthManager |
add() | Adds a new authenticator by name. | MOXMAN_Auth_AuthManager |
clearCache() | Clears the authentication cache. | MOXMAN_Auth_AuthManager |
get() | Return a authenticator instance by name or null if it doesn't exist. | MOXMAN_Auth_AuthManager |
getClientAuthData() | Returns client access data such as passed in session id:s or oAuth accessTokens. | MOXMAN_Auth_AuthManager |
getUser() | Returns the current user. | MOXMAN_Auth_AuthManager |
has() | Returns true/false if the specified authenticator by name exists or not. | MOXMAN_Auth_AuthManager |
hasStandalone() | Returns true/false if one of the authenticators is standalone. | MOXMAN_Auth_AuthManager |
isAuthenticated() | Returns true/false if the user if authenticated or not. It will call the authenticate method on all authenticator instances and depending on the auth order it will OR or AND them. | MOXMAN_Auth_AuthManager |
login() | This method will call the login method on all authenticators to provide a way for a user to login and authenticate them selfs. | MOXMAN_Auth_AuthManager |
logout() | Logs out the current user. This will call the logout method to all authenticators. | MOXMAN_Auth_AuthManager |
remove() | Removes the authenticator by name. | MOXMAN_Auth_AuthManager |
setAuthenticationOrder() | MOXMAN_Auth_AuthManager | |
setClientAuthData() | Sets access information passed form client. This might be accessTokens for oAuth taken from localStorage or other client specific access info like session id:s. | MOXMAN_Auth_AuthManager |
Method Details
Constructs a new authentication manager instance.
public void __construct ( $authenticatorOrder = "" ) | ||
$authenticatorOrder | mixed | Separated list of authenticators that will be executed. |
Adds a new authenticator by name.
public void add ( $name, MOXMAN_Auth_IAuthenticator $authenticator ) | ||
$name | string | Authenticator name for example SessionAuthenticator. |
$authenticator | MOXMAN_Auth_IAuthenticator | Authenticator instance to add. |
Clears the authentication cache.
public void clearCache ( ) |
Return a authenticator instance by name or null if it doesn't exist.
public MOXMAN_Auth_IAuthenticator get ( $name ) | ||
$name | string | Authenticator by name to retrive. |
return | MOXMAN_Auth_IAuthenticator | Authenticator instance or null. |
---|
Returns client access data such as passed in session id:s or oAuth accessTokens.
public stdClass getClientAuthData ( ) | ||
return | stdClass | Access data instance. |
---|
Returns the current user.
public MOXMAN_Auth_User getUser ( ) | ||
return | MOXMAN_Auth_User | Current user instance. |
---|
Returns true/false if the specified authenticator by name exists or not.
public Boolean has ( $name ) | ||
$name | string | Name of the authenticator to look for. |
return | Boolean | True/false state of the authenticator exists or not. |
---|
Returns true/false if one of the authenticators is standalone.
public Boolean hasStandalone ( ) | ||
return | Boolean | True/false if any authenticator has standalone support. |
---|
Returns true/false if the user if authenticated or not. It will call the authenticate method on all authenticator instances and depending on the auth order it will OR or AND them.
public \ture/false isAuthenticated ( ) | ||
return | \ture/false | If the user is logged in or not. |
---|
This method will call the login method on all authenticators to provide a way for a user to login and authenticate them selfs.
public Boolean login ( $username, $password, $persistent = false ) | ||
$username | string | User name to login. |
$password | string | Password to use in login. |
$persistent | boolean | Persistent user auth state. |
return | Boolean | True/false if the user was logged in or not. |
---|
Logs out the current user. This will call the logout method to all authenticators.
public void logout ( ) |
Removes the authenticator by name.
public void remove ( $name ) | ||
$name | string | Name of the authenticator to remove. |
public void setAuthenticationOrder ( $order ) | ||
$order |
Sets access information passed form client. This might be accessTokens for oAuth taken from localStorage or other client specific access info like session id:s.
public void setClientAuthData ( $info ) | ||
$info | stdClass | Object with access data. |