ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
This plugin provides Authentication for a WebDAV server. More...
Public Member Functions | |
__construct (Backend\BackendInterface $authBackend=null) | |
Creates the authentication plugin. More... | |
addBackend (Backend\BackendInterface $authBackend) | |
Adds an authentication backend to the plugin. More... | |
initialize (Server $server) | |
Initializes the plugin. More... | |
getPluginName () | |
Returns a plugin name. More... | |
getCurrentPrincipal () | |
Returns the currently logged-in principal. More... | |
beforeMethod (RequestInterface $request, ResponseInterface $response) | |
This method is called before any HTTP method and forces users to be authenticated. More... | |
check (RequestInterface $request, ResponseInterface $response) | |
Checks authentication credentials, and logs the user in if possible. More... | |
challenge (RequestInterface $request, ResponseInterface $response) | |
This method sends authentication challenges to the user. More... | |
getLoginFailedReasons () | |
Returns a list of reasons why login was unsuccessful. More... | |
getPluginInfo () | |
Returns a bunch of meta-data about the plugin. More... | |
Public Member Functions inherited from Sabre\DAV\ServerPlugin | |
initialize (Server $server) | |
This initializes the plugin. More... | |
getFeatures () | |
This method should return a list of server-features. More... | |
getHTTPMethods ($path) | |
Use this method to tell the server this plugin defines additional HTTP methods. More... | |
getPluginName () | |
Returns a plugin name. More... | |
getSupportedReportSet ($uri) | |
Returns a list of reports this plugin supports. More... | |
getPluginInfo () | |
Returns a bunch of meta-data about the plugin. More... | |
Data Fields | |
$autoRequireLogin = true | |
By default this plugin will require that the user is authenticated, and refuse any access if the user is not authenticated. More... | |
Protected Attributes | |
$backends | |
authentication backends More... | |
$currentPrincipal | |
$loginFailedReasons | |
This plugin provides Authentication for a WebDAV server.
It works by providing a Auth class. Several examples of these classes can be found in the Backend directory.
It's possible to provide more than one backend to this plugin. If more than one backend was provided, each backend will attempt to authenticate. Only if all backends fail, we throw a 401.
Definition at line 25 of file Plugin.php.
Sabre\DAV\Auth\Plugin::__construct | ( | Backend\BackendInterface | $authBackend = null | ) |
Creates the authentication plugin.
Backend\BackendInterface | $authBackend |
Definition at line 59 of file Plugin.php.
References $authBackend, and Sabre\DAV\Auth\Plugin\addBackend().
Sabre\DAV\Auth\Plugin::addBackend | ( | Backend\BackendInterface | $authBackend | ) |
Adds an authentication backend to the plugin.
Backend\BackendInterface | $authBackend |
Definition at line 73 of file Plugin.php.
References $authBackend.
Referenced by Sabre\DAV\Auth\Plugin\__construct().
Sabre\DAV\Auth\Plugin::beforeMethod | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
This method is called before any HTTP method and forces users to be authenticated.
RequestInterface | $request | |
ResponseInterface | $response |
Definition at line 130 of file Plugin.php.
References Sabre\DAV\Auth\Plugin\challenge(), and Sabre\DAV\Auth\Plugin\check().
Sabre\DAV\Auth\Plugin::challenge | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
This method sends authentication challenges to the user.
This method will for example cause a HTTP Basic backend to set a WWW-Authorization header, indicating to the client that it should authenticate.
RequestInterface | $request | |
ResponseInterface | $response |
Definition at line 232 of file Plugin.php.
Referenced by Sabre\DAV\Auth\Plugin\beforeMethod().
Sabre\DAV\Auth\Plugin::check | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
Checks authentication credentials, and logs the user in if possible.
This method returns an array. The first item in the array is a boolean indicating if login was successful.
If login was successful, the second item in the array will contain the current principal url/path of the logged in user.
If login was not successful, the second item in the array will contain a an array with strings. The strings are a list of reasons why login was unsuccessful. For every auth backend there will be one reason, so usually there's just one.
RequestInterface | $request | |
ResponseInterface | $response |
Definition at line 191 of file Plugin.php.
References $result.
Referenced by Sabre\DAV\Auth\Plugin\beforeMethod().
Sabre\DAV\Auth\Plugin::getCurrentPrincipal | ( | ) |
Returns the currently logged-in principal.
This will return a string such as:
principals/username principals/users/username
This method will return null if nobody is logged in.
Definition at line 117 of file Plugin.php.
References Sabre\DAV\Auth\Plugin\$currentPrincipal.
Sabre\DAV\Auth\Plugin::getLoginFailedReasons | ( | ) |
Returns a list of reasons why login was unsuccessful.
This method will return the login failed reasons for the last login operation. One for each auth backend.
This method returns null if the last authentication attempt was successful, or if there was no authentication attempt yet.
Definition at line 258 of file Plugin.php.
References Sabre\DAV\Auth\Plugin\$loginFailedReasons.
Sabre\DAV\Auth\Plugin::getPluginInfo | ( | ) |
Returns a bunch of meta-data about the plugin.
Providing this information is optional, and is mainly displayed by the Browser plugin.
The description key in the returned array may contain html and will not be sanitized.
Definition at line 275 of file Plugin.php.
References Sabre\DAV\Auth\Plugin\getPluginName().
Sabre\DAV\Auth\Plugin::getPluginName | ( | ) |
Returns a plugin name.
Using this name other plugins will be able to access other plugins using DAV::getPlugin
Definition at line 99 of file Plugin.php.
Referenced by Sabre\DAV\Auth\Plugin\getPluginInfo().
Sabre\DAV\Auth\Plugin::initialize | ( | Server | $server | ) |
Initializes the plugin.
This function is automatically called by the server
Server | $server |
Definition at line 85 of file Plugin.php.
References Sabre\Event\EventEmitterInterface\on().
Sabre\DAV\Auth\Plugin::$autoRequireLogin = true |
By default this plugin will require that the user is authenticated, and refuse any access if the user is not authenticated.
If this setting is set to false, we let the user through, whether they are authenticated or not.
This is useful if you want to allow both authenticated and unauthenticated access to your server.
bool |
Definition at line 39 of file Plugin.php.
|
protected |
authentication backends
Definition at line 44 of file Plugin.php.
|
protected |
Definition at line 52 of file Plugin.php.
Referenced by Sabre\DAV\Auth\Plugin\getCurrentPrincipal().
|
protected |
Definition at line 245 of file Plugin.php.
Referenced by Sabre\DAV\Auth\Plugin\getLoginFailedReasons().