Debian Codegraph @

doc/sources/admin/idpsaml.rst

raw
1 SAML Identity Provider
2 ======================
3
4 Presentation
5 ------------
6
7 LL::NG can act as an SAML 2.0 Identity Provider, that can allow one to
8 federate LL::NG with:
9
10 - Another LL::NG system configured with
11 :doc:`SAML authentication<authsaml>`
12 - Any SAML Service Provider
13
14 Configuration
15 -------------
16
17 SAML Service
18 ~~~~~~~~~~~~
19
20 See :doc:`SAML service<samlservice>` configuration chapter.
21
22 IssuerDB
23 ~~~~~~~~
24
25 Go in ``General Parameters`` » ``Issuer modules`` » ``SAML`` and
26 configure:
27
28 - **Activation**: set to ``On``.
29 - **Path**: keep ``^/saml/`` unless you have change SAML end points
30 suffix in :doc:`SAML service configuration<samlservice>`.
31 - **Use rule**: a rule to allow user to use this module, set to ``1``
32 to always allow.
33
34
35 .. tip::
36
37 For example, to allow only users with a strong authentication
38 level:
39
40 ::
41
42 $authenticationLevel > 2
43
44
45
46 Register LemonLDAP::NG on partner Service Provider
47 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48
49 After configuring SAML Service, you can export metadata to your partner
50 Service Provider.
51
52 They are available at the Metadata URL, by default:
53 http://auth.example.com/saml/metadata.
54
55 You can also use http://auth.example.com/saml/metadata/idp to have only
56 IDP related metadata.
57
58 In both cases, the entityID of the LemonLDAP::NG server is
59 http://auth.example.com/saml/metadata
60
61 .. _samlidp-register-sp:
62
63 Register partner Service Provider on LemonLDAP::NG
64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65
66 In the Manager, select node SAML service providers and click on
67 ``Add SAML SP``.
68
69 The SP name is asked, enter it and click OK.
70
71 Now you have access to the SP parameters list.
72
73 Metadata
74 ^^^^^^^^
75
76 You must register SP metadata here. You can do it either by uploading
77 the file, or get it from SP metadata URL (this require a network link
78 between your server and the SP).
79
80 |image0|
81
82
83 .. tip::
84
85 You can also edit the metadata directly in the textarea
86
87 Exported attributes
88 ^^^^^^^^^^^^^^^^^^^
89
90 |image1|
91
92 For each attribute, you can set:
93
94 - **Variable name**: name of the variable in LemonLDAP::NG session
95 - **Attribute name**: name of the SAML attribute that will be seen by applications
96 - **Friendly Name**: optional, friendly name of the SAML attribute seen by applications
97 - **Mandatory**: if set to "On", then this attribute is required to
98 build the SAML response, an error will displayed if there is no value
99 for it. Optional attribute will be sent only if there is a value
100 associated. Else it just will be sent through an attribute response,
101 if explicitly requested in an attribute request.
102 - **Format**: optional, SAML attribute name format.
103
104 Special attributes
105 ^^^^^^^^^^^^^^^^^^
106
107 The special variable name ``__persistent_name_id`` lets you define an attribute
108 whose value is a persistent NameID object. It is mostly useful for the
109 ``eduPersonTargetedID`` legacy attribute. This attribute will only have a value
110 if a *persistent* NameID is returned. So make sure that either the SP requests
111 a a *persistent* NameID, or you forced the format to *persistent* in the
112 *Authentication response* options.
113
114 Options
115 ^^^^^^^
116
117 Authentication response
118 '''''''''''''''''''''''
119
120 - **Default NameID format**: if no NameID format is requested, or the
121 NameID format undefined, this NameID format will be used. If no
122 value, the default NameID format is Email.
123 - **Force NameID format**: some SPs ask for a particular NameID format in
124 their SAML request. Enable this option to always use the default NameID
125 format even if the SP requests another one.
126 - **Force NameID session key**: if empty, the NameID mapping defined in
127 :doc:`SAML service<samlservice>` configuration will be used. You can
128 force here another session key that will be used as NameID content.
129 - **One Time Use**: set the OneTimeUse flag in authentication response
130 (``<Condtions>``).
131 - **sessionNotOnOrAfter duration**: Time in seconds, added to
132 authentication time, to define sessionNotOnOrAfter value in SAML
133 response (``<AuthnStatement>``):
134
135 .. code-block:: xml
136
137 <saml:AuthnStatement AuthnInstant="2014-07-21T11:47:08Z"
138 SessionIndex="loVvqZX+Vja2dtgt/N+AymTmckGyITyVt+UJ6vUFSFkE78S8zg+aomXX7oZ9qX1UxOEHf6Q4DUstewSJh1uK1Q=="
139 SessionNotOnOrAfter="2014-07-21T15:47:08Z">
140
141 - **notOnOrAfter duration**: Time in seconds, added to authentication
142 time, to define notOnOrAfter value in SAML response (``<Condtions>``
143 and ``<SubjectConfirmationData>``):
144
145 .. code-block:: xml
146
147 <saml:SubjectConfirmationData NotOnOrAfter="2014-07-21T12:47:08Z"
148 Recipient="http://simplesamlphp.example.com/simplesamlphp/module.php/saml/sp/saml2-acs.php/default-sp"
149 InResponseTo="_3cfa896ab05730ac81f413e1e13cc42aa529eceea1"/>
150
151 .. code-block:: xml
152
153 <saml:Conditions NotBefore="2014-07-21T11:46:08Z"
154 NotOnOrAfter="2014-07-21T12:48:08Z">
155
156
157 .. attention::
158
159 There is a time tolerance of 60 seconds in
160 ``<Conditions>``\
161
162 - **Force UTF-8**: Activate to force UTF-8 decoding of values in SAML
163 attributes. If set to 0, the value from the session is directly
164 copied into SAML attribute.
165
166 Signature
167 '''''''''
168
169 These options override service signature options (see
170 :ref:`SAML service configuration<samlservice-general-options>`).
171
172 - **Signature method**: the algorithm used to sign messages sent to this service
173 - **Signing key name**: Since ``2.22.0``. If you want to use a specific
174 signing key only for responses sent to this RP, indicate the name of a key
175 from the :doc:`key management section <keys>`. If you specify multiple
176 values separated by a comma, the first key will be used for signing
177 responses, and the others will be published in metadata if you use the
178 ``/saml/metadata/idp?sp=<entityid>`` endpoint
179 - **Sign SSO message**: Sign SSO message
180 - **Check SSO message signature**: "On" means that LemonLDAP::NG will verify
181 signatures if IDP and SP metadata require it. "Off" will disable signature
182 verification entirely.
183 - **Sign SLO message**: Sign SLO message
184 - **Check SLO message signature**
185
186 Security
187 ''''''''
188
189 - **Encryption mode**: set the encryption mode for this SP (None, NameID or Assertion).
190 - **Enable use of IDP initiated URL**: set to ``On`` to enable IDP Initiated URL on this SP.
191 - **Required authentication level**: required authentication level to access
192 this SP. Since ``2.21.0`` this can be a Perl expression.
193 - **Access rule**: lets you specify a :doc:`Perl rule<rules_examples>` to restrict access to this SP
194
195 Federation
196 ''''''''''
197
198 See :doc:`samlfederation`
199
200 Metadata URL
201 ''''''''''''
202
203 Store the URL that can be used to refresh metadata
204
205 Comment: set a comment
206 ''''''''''''''''''''''
207
208 Macros
209 ^^^^^^
210
211 You can define here macros that will be only evaluated for this service,
212 and not registered in the session of the user.
213
214 Extra variables
215 ^^^^^^^^^^^^^^^
216
217 The following environment variables are available in SAML access rules and macros:
218
219 * ``$env->{llng_saml_sp}`` : entityID of the SAML service
220 * ``$env->{llng_saml_spconfkey}`` : configuration key of the SAML service
221
222 .. versionadded:: 2.0.10
223
224 * ``$env->{llng_saml_acs}`` : AssertionConsumerServiceURL, if specified in the AuthnRequest
225
226 IDP Initiated mode
227 ^^^^^^^^^^^^^^^^^^
228
229 The IDP Initiated URL is the SSO SAML URL with GET parameters:
230
231 - ``IDPInitiated``: ``1``
232 - One of:
233
234 - ``sp``: Service Provider entity ID
235 - ``spConfKey``: Service Provider configuration key
236
237 For example:
238 http://auth.example.com/saml/singleSignOn?IDPInitiated=1&spConfKey=simplesamlphp
239
240 - Optionally, if you may also specify, in addition to ``sp`` or ``spConfKey``:
241
242 - ``spDest``: URL of Service Provider's AssertionConsumerService
243
244 The URL specified in ``spDest`` *must* be present in the Service Provider metadata registered in LemonLDAP::NG. This is only useful if your Service Provider is reachable over multiple URLs.
245
246 Known issues
247 ------------
248
249 Using both Issuer::SAML and Auth::SAML on the same LLNG may have some
250 side-effects on single-logout.
251
252 .. |image0| image:: /documentation/manager-saml-metadata.png
253 :class: align-center
254 .. |image1| image:: /documentation/manager-saml-attributes.png
255 :class: align-center
256