| 1 |
SecureToken Handler |
| 2 |
=================== |
| 3 |
|
| 4 |
Presentation |
| 5 |
------------ |
| 6 |
|
| 7 |
The SecureToken Handler is a particular Handler that generates a token at |
| 8 |
each request and send it to protected application. User identifier is |
| 9 |
stored in a Memcached server and the protected application |
| 10 |
can retrieve the user identifier from the Memcached server. |
| 11 |
|
| 12 |
This mechanism allows one to protect an application with an unsafe link |
| 13 |
between Handler and the application, but with a safe link between the |
| 14 |
Memcached server and the application. |
| 15 |
|
| 16 |
Configuration |
| 17 |
------------- |
| 18 |
|
| 19 |
Install Cache::Memcached dependency. |
| 20 |
|
| 21 |
Virtual host |
| 22 |
~~~~~~~~~~~~ |
| 23 |
|
| 24 |
You just have to set "Type: SecureToken" in the VirtualHost options in manager. |
| 25 |
|
| 26 |
If you want to protect only a virtualHost location, select "Main" in |
| 27 |
the manager and set type in your web server configuration file: |
| 28 |
|
| 29 |
- Apache: just use ``PerlSetVar VHOSTTYPE SecureToken`` directive |
| 30 |
- Nginx: set ``fastcgi_param VHOSTTYPE SecureToken;`` parameter |
| 31 |
|
| 32 |
.. note:: |
| 33 |
|
| 34 |
This handler uses Apache2Filter Module to hide token, prefer |
| 35 |
:doc:`Handling server webservice calls<servertoserver>` for other |
| 36 |
servers. |
| 37 |
|
| 38 |
Handler parameters |
| 39 |
~~~~~~~~~~~~~~~~~~ |
| 40 |
|
| 41 |
SecureToken parameters are the following: |
| 42 |
|
| 43 |
- **Memcached servers**: space-separated list of Memcached server addresses |
| 44 |
- **Token expiration**: time in seconds for token expiration (remove |
| 45 |
from Memcached server) |
| 46 |
- **Attribute to store**: session key that will be stored in Memcached |
| 47 |
- **Protected URLs**: space-separated list of Regexp to match URLs for |
| 48 |
which the secure token will be sent |
| 49 |
- **Header name**: HTTP header name to carry out the secure token |
| 50 |
- **Allow requests in error**: allow a request that has generated an |
| 51 |
error during token generation to be forwarded to the protected |
| 52 |
application without secure token (default: yes) |
| 53 |
|
| 54 |
|
| 55 |
.. attention:: |
| 56 |
|
| 57 |
SecureToken Handler paremeters must be set in ``lemonldap-ng.ini`` file |
| 58 |
not in Manager, for example: |
| 59 |
|
| 60 |
.. code:: ini |
| 61 |
|
| 62 |
[handler] |
| 63 |
secureTokenMemcachedServers = 127.0.0.1:11211 |
| 64 |
secureTokenExpiration = 60 |
| 65 |
secureTokenAttribute = uid |
| 66 |
secureTokenUrls = .* |
| 67 |
secureTokenHeader = Auth-Token |
| 68 |
secureTokenAllowOnError = 1 |