| 1 |
SAML |
| 2 |
==== |
| 3 |
|
| 4 |
============== ===== ======== |
| 5 |
Authentication Users Password |
| 6 |
============== ===== ======== |
| 7 |
✔ ✔ |
| 8 |
============== ===== ======== |
| 9 |
|
| 10 |
Presentation |
| 11 |
------------ |
| 12 |
|
| 13 |
LL::NG can use SAML2 to get user identity and grab some attributes |
| 14 |
defined in user profile on its Identity Provider (IDP). In this case, |
| 15 |
LL::NG acts like an SAML2 Service Provider (SP). |
| 16 |
|
| 17 |
Several IDPs are allowed, in this case the user will choose the IDP he |
| 18 |
wants. You can preselect IDP with an IDP resolution rule. |
| 19 |
|
| 20 |
For each IDP, you can configure attributes that are collected. Some can |
| 21 |
be mandatory, so if they are not returned by IDP, the session will not be |
| 22 |
opened. |
| 23 |
|
| 24 |
|
| 25 |
.. tip:: |
| 26 |
|
| 27 |
LL::NG can also act as :doc:`SAML IDP<idpsaml>`, that allows |
| 28 |
one to interconnect two LL::NG systems. |
| 29 |
|
| 30 |
Configuration |
| 31 |
------------- |
| 32 |
|
| 33 |
SAML Service |
| 34 |
~~~~~~~~~~~~ |
| 35 |
|
| 36 |
See :doc:`SAML service<samlservice>` configuration chapter. |
| 37 |
|
| 38 |
|
| 39 |
.. attention:: |
| 40 |
|
| 41 |
Browser implementations of formAction directive are |
| 42 |
inconsistent (e.g. Firefox doesn't block the redirects whereas Chrome |
| 43 |
does). Administrators may have to modify formAction value with wildcard |
| 44 |
likes \*. |
| 45 |
|
| 46 |
In Manager, go in : |
| 47 |
|
| 48 |
``General Parameters`` > ``Advanced Parameters`` > ``Security`` > |
| 49 |
``Content Security Policy`` > ``Form destination`` |
| 50 |
|
| 51 |
Authentication and UserDB |
| 52 |
~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 53 |
|
| 54 |
In ``General Parameters`` > ``Authentication modules``, set: |
| 55 |
|
| 56 |
- Authentication module: SAML v2 |
| 57 |
- Users module: Same (eq SAML) |
| 58 |
|
| 59 |
|
| 60 |
.. tip:: |
| 61 |
|
| 62 |
As passwords will not be managed by LL::NG, you can disable |
| 63 |
:ref:`menu password module<portalmenu-menu-modules>`. |
| 64 |
|
| 65 |
Register LemonLDAP::NG on partner Identity Provider |
| 66 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 67 |
|
| 68 |
After configuring SAML Service, you can export metadata to your partner |
| 69 |
Identity Provider. |
| 70 |
|
| 71 |
They are available at the EntityID URL, by default: |
| 72 |
http://auth.example.com/saml/metadata. You can also use |
| 73 |
http://auth.example.com/saml/metadata/sp to have only SP related |
| 74 |
metadata. |
| 75 |
|
| 76 |
Register partner Identity Provider on LemonLDAP::NG |
| 77 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 78 |
|
| 79 |
In the Manager, select node ``SAML identity providers`` and click on |
| 80 |
``Add SAML IDP``. The IDP name is asked, enter it and click OK. |
| 81 |
|
| 82 |
Metadata |
| 83 |
^^^^^^^^ |
| 84 |
|
| 85 |
You must register IDP metadata here. You can do it either by uploading |
| 86 |
the file, or get it from IDP metadata URL (this require a network link |
| 87 |
between your server and the IDP): |
| 88 |
|
| 89 |
|image0| |
| 90 |
|
| 91 |
|
| 92 |
.. tip:: |
| 93 |
|
| 94 |
You can also edit the metadata directly in the textarea. |
| 95 |
|
| 96 |
Exported attributes |
| 97 |
^^^^^^^^^^^^^^^^^^^ |
| 98 |
|
| 99 |
For each attribute, you can set: |
| 100 |
|
| 101 |
- **Variable name**: name of the variable in LemonLDAP::NG session that will contain this attribute. For example |
| 102 |
"uid" will then be used as $uid in access rules |
| 103 |
- **Attribute name**: name of the SAML attribute coming from the remote IDP |
| 104 |
- **Friendly Name**: optional, SAML attribute friendly name. |
| 105 |
- **Mandatory**: if set to On, session will not be created if this |
| 106 |
attribute is not sent by IDP. |
| 107 |
- **Format** (optional): SAML attribute format. |
| 108 |
|
| 109 |
|image1| |
| 110 |
|
| 111 |
Session |
| 112 |
^^^^^^^ |
| 113 |
|
| 114 |
- **Adapt session lifetime**: Session lifetime will be adapted from |
| 115 |
``SessionNotOnOrAfter`` value found in authentication response. It |
| 116 |
means that if the IDP propose to close session earlier than the |
| 117 |
default LemonLDAP::NG timeout, the session \_utime will be modified |
| 118 |
so that session is erased at the date indicated by the IDP. |
| 119 |
- **Force UTF-8**: This will force UTF-8 conversion of attributes |
| 120 |
values collected from IDP. |
| 121 |
- **Store SAML Token**: Allows one to keep SAML token (assertion) |
| 122 |
inside user session. Don't enable it unless you need to replay this |
| 123 |
token on an application. |
| 124 |
- **Attribute containing user identifier**: Set the value of SAML |
| 125 |
attribute ("Name") that should be used as user main identifier |
| 126 |
($user). If empty, the NameID content is used. |
| 127 |
|
| 128 |
Signature |
| 129 |
^^^^^^^^^ |
| 130 |
|
| 131 |
These options override service signature options (see |
| 132 |
:ref:`SAML service configuration<samlservice-general-options>`). |
| 133 |
|
| 134 |
- **Signature method**: Signature method for requests sent to this provider |
| 135 |
- **Signing key name**: Since ``2.22.0``. If you want to use a specific |
| 136 |
signing key only for requests sent to this IDP, indicate the name of a key |
| 137 |
from the :doc:`key management section <keys>`. If you specify multiple |
| 138 |
values separated by a comma, the first key will be used for signing |
| 139 |
requests, and the others will be published in metadata if you use the |
| 140 |
``/saml/metadata/sp?idp=<entityid>`` endpoint. |
| 141 |
- **Sign SSO message**: Sign SSO message |
| 142 |
- **Check SSO message signature**: Check SSO message signature |
| 143 |
- **Sign SLO message**: Sign SLO message |
| 144 |
- **Check SLO message signature**: Check SLO message signature |
| 145 |
|
| 146 |
Binding |
| 147 |
^^^^^^^ |
| 148 |
|
| 149 |
- **SSO binding**: Force binding to use for SSO (http-redirect, |
| 150 |
http-post, etc.) |
| 151 |
- **SLO binding**: Force binding to use for SLO (http-redirect, |
| 152 |
http-post, etc.) |
| 153 |
|
| 154 |
|
| 155 |
.. note:: |
| 156 |
|
| 157 |
If no binding is defined, the default binding in IDP metadata |
| 158 |
will be used. |
| 159 |
|
| 160 |
Security |
| 161 |
^^^^^^^^ |
| 162 |
|
| 163 |
- **Encryption mode**: Set the encryption mode for this IDP (None, |
| 164 |
NameID or Assertion). |
| 165 |
- **Check time conditions**: Set to Off to disable time conditions |
| 166 |
checking on authentication responses. |
| 167 |
- **Check audience conditions**: Set to Off to disable audience |
| 168 |
conditions checking on authentication responses. |
| 169 |
|
| 170 |
Options |
| 171 |
^^^^^^^ |
| 172 |
|
| 173 |
Authentication request |
| 174 |
'''''''''''''''''''''' |
| 175 |
|
| 176 |
- **NameID format**: force NameID format here (email, persistent, |
| 177 |
transient, etc.). If no value, will use first NameID Format activated |
| 178 |
in metadata. |
| 179 |
- **Force authentication**: set ForceAuthn flag in authentication |
| 180 |
request |
| 181 |
- **Passive authentication**: set IsPassive flag in authentication |
| 182 |
request |
| 183 |
- **Allow login from IDP**: allow a user to connect directly from an |
| 184 |
IDP link. In this case, authentication is not a response to an issued |
| 185 |
authentication request, and we have less control on conditions. |
| 186 |
- **Requested authentication context**: this context is declared in |
| 187 |
authentication request. When receiving the request, the real |
| 188 |
authentication context will be mapped to an internal authentication |
| 189 |
level (see |
| 190 |
:ref:`how configure the mapping<samlservice-authentication-contexts>`), |
| 191 |
that you can check to allow or deny session creation. |
| 192 |
- **Allow URL as RelayState**: set to On if the RelayState value sent |
| 193 |
by IDP is the URL where the user must be redirected after |
| 194 |
authentication |
| 195 |
- **Federation**: see :doc:`samlfederation` |
| 196 |
- **Activation**: The user can activate and deactivate a SP. By default, SPs |
| 197 |
are active upon creation. |
| 198 |
- **Metadata URL**: Store the URL that can be used to refresh metadata |
| 199 |
- **Comment**: set a comment |
| 200 |
|
| 201 |
|
| 202 |
Display |
| 203 |
^^^^^^^ |
| 204 |
|
| 205 |
Used only if at least 2 SAML Identity Providers are declared |
| 206 |
|
| 207 |
- **Name**: Name of the IDP |
| 208 |
- **Logo**: Logo of the IDP |
| 209 |
|
| 210 |
.. tip:: |
| 211 |
|
| 212 |
The chosen logo must be in Portal icons directory |
| 213 |
(``portal/static/common/``). You can set a custom icon by setting the |
| 214 |
icon file name directly in the field and copy the logo file in portal |
| 215 |
icons directory |
| 216 |
|
| 217 |
- **Tooltip**: Information displayed on mouse over the button |
| 218 |
- **Resolution rule**: Rule that will be applied to preselect an IDP |
| 219 |
for a user. You have access to all environment variable *(like user |
| 220 |
IP address)* and all session keys. |
| 221 |
|
| 222 |
For example, to preselect this IDP for users coming from 192.168.0.0/16 |
| 223 |
network :: |
| 224 |
|
| 225 |
$ENV{REMOTE_ADDR} =~ /^192\.168/ |
| 226 |
|
| 227 |
$env->{REMOTE_ADDR} =~ /^192\.168/ |
| 228 |
|
| 229 |
inSubnet('192.168.0.0/16') |
| 230 |
|
| 231 |
To preselect this IDP when the ``MY_IDP`` :doc:`choice <authchoice>` is selected :: |
| 232 |
|
| 233 |
$_choice eq "MY_IDP" |
| 234 |
|
| 235 |
- **Order**: Used for sorting IDP |
| 236 |
|
| 237 |
Manual IDP Selection |
| 238 |
-------------------- |
| 239 |
|
| 240 |
When using multiple SAML IDPs, LemonLDAP will display an additional choice |
| 241 |
screen to let the user decide which IDP they want to use. |
| 242 |
|
| 243 |
In addition to the *resolution rule* described above, you can also use the |
| 244 |
``idp`` or ``idpName`` URL parameters to automatically select an IDP for the |
| 245 |
user. |
| 246 |
|
| 247 |
Use the ``idp`` parameter to specify the SAML Entity ID of the provider. |
| 248 |
Do not forget to url-encode the value: |
| 249 |
``https://auth.example.com/?idp=https%3A%2F%2Fidp.example.com%2Fsaml``. |
| 250 |
|
| 251 |
Alternatively, use the ``idpName`` parameter to specify the name of the |
| 252 |
provider in the LemonLDAP::NG manager: |
| 253 |
``https://auth.example.com/?idpName=idp-example`` |
| 254 |
|
| 255 |
.. |image0| image:: /documentation/manager-saml-metadata.png |
| 256 |
:class: align-center |
| 257 |
.. |image1| image:: /documentation/manager-saml-attributes.png |
| 258 |
:class: align-center |