| 1 |
GLPI |
| 2 |
==== |
| 3 |
|
| 4 |
|image0| |
| 5 |
|
| 6 |
Presentation |
| 7 |
------------ |
| 8 |
|
| 9 |
`GLPI <http://www.glpi-project.org>`__ is the Information |
| 10 |
Resource-Manager with an additional Administration- Interface. You can |
| 11 |
use it to build up a database with an inventory for your company |
| 12 |
(computer, software, printers...). It has enhanced functions to make the |
| 13 |
daily life for the administrators easier, like a job-tracking-system |
| 14 |
with mail-notification and methods to build a database with basic |
| 15 |
information about your network-topology. |
| 16 |
|
| 17 |
Configuration |
| 18 |
------------- |
| 19 |
|
| 20 |
In Lemonldap you will need to create a new Virtual Host as follows: |
| 21 |
`Virtual Hosts` -> `Add virtualhost`: `glpi.example.com` |
| 22 |
|
| 23 |
On the virtual host the `Access rules` can be configured to `accept` as the |
| 24 |
`Default rule`. This is for testing purposes but you can read the following |
| 25 |
`documentation <https://lemonldap-ng.org/documentation/latest/writingrulesand_headers.html#rules>`__. |
| 26 |
|
| 27 |
In `Exported headers` the attributes picked sent to GLPI need to be configured: |
| 28 |
|
| 29 |
.. code-block:: bash |
| 30 |
|
| 31 |
AUTH-GIVENNAME => $givenName |
| 32 |
AUTH-MAIL => $mail |
| 33 |
AUTH-SN => $sn |
| 34 |
|
| 35 |
Next we will need to configure the reverse proxy to retrieve the headers from |
| 36 |
lemonldap and send them to GLPI after authentication has been completed. |
| 37 |
If you use Nginx, you need to create the following configuration: |
| 38 |
|
| 39 |
.. code-block:: nginx |
| 40 |
|
| 41 |
server { |
| 42 |
listen 80; |
| 43 |
server_name glpi.example.com; |
| 44 |
location = /lmauth { |
| 45 |
internal; |
| 46 |
include /etc/nginx/fastcgi_params; |
| 47 |
fastcgi_pass unix:/var/run/llng-fastcgi-server/llng-fastcgi.sock; |
| 48 |
fastcgi_pass_request_body off; |
| 49 |
fastcgi_param CONTENT_LENGTH ""; |
| 50 |
fastcgi_param HTTP_HOST $host; |
| 51 |
fastcgi_param X_ORIGINAL_URI $original_uri; |
| 52 |
auth_request_set $lmlocation $upstream_http_location; |
| 53 |
} |
| 54 |
|
| 55 |
location / { |
| 56 |
auth_request /lmauth; |
| 57 |
set $original_uri $uri$is_args$args; |
| 58 |
|
| 59 |
error_page 401 $lmlocation; |
| 60 |
|
| 61 |
proxy_pass http://glpi/; |
| 62 |
include /etc/nginx/proxy_params; |
| 63 |
|
| 64 |
auth_request_set $lmremote_user $upstream_http_lm_remote_user; |
| 65 |
proxy_set_header REMOTE-USER $lmremote_user; |
| 66 |
auth_request_set $authmail $upstream_http_auth_mail; |
| 67 |
proxy_set_header AUTH-MAIL $authmail; |
| 68 |
auth_request_set $authsn $upstream_http_auth_sn; |
| 69 |
proxy_set_header AUTH-SN $authsn; |
| 70 |
auth_request_set $authgivenname $upstream_http_auth_givenname; |
| 71 |
proxy_set_header AUTH-GIVENNAME $authgivenname; |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
The above example is a modified configuration that can be found |
| 76 |
`here <https://lemonldap-ng.org/documentation/latest/configvhost.html>`__. |
| 77 |
|
| 78 |
Take note of the `proxy_set_header` and `auth_request_set` configurations at the |
| 79 |
end the nginx configuration block. This follows a specific convention which is |
| 80 |
described on this page for `Apache2 and Nginx <https://lemonldap-ng.org/documentation/latest/header_remote_user_conversion.html>`__. |
| 81 |
|
| 82 |
In addition you will need the below `proxy_params` configurations as defined in |
| 83 |
the nginx configuration above: |
| 84 |
|
| 85 |
.. code-block:: nginx |
| 86 |
|
| 87 |
proxy_set_header Host $host; |
| 88 |
proxy_set_header X-Forwarded-Host $host; |
| 89 |
proxy_set_header X-Real-IP $remote_addr; |
| 90 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 91 |
|
| 92 |
For GLPI it is a simple configuration in GLPI: Setup → Authentication. |
| 93 |
In “External authentications” click “Others authentication methods” and in the |
| 94 |
section "Other authentication sent in the HTTP request" you will need to |
| 95 |
configure the following: |
| 96 |
|
| 97 |
.. code-block:: bash |
| 98 |
|
| 99 |
Field storage of the login in the HTTP request => HTTP_REMOTE_USER |
| 100 |
SSO logout url => http://auth.example.com/?logout=1 |
| 101 |
First name => HTTP_AUTH_GIVENNAME |
| 102 |
Surname => HTTP_AUTH_SN |
| 103 |
Email => HTTP_AUTH_MAIL |
| 104 |
|
| 105 |
It is important to note the naming convention of the HTTP headers being |
| 106 |
configured between Lemonldap, Nginx and GLPI. |
| 107 |
|
| 108 |
.. |image0| image:: /applications/glpi_logo.png |
| 109 |
:class: align-center |
| 110 |
|