| 1 |
Connect to SAML Federations |
| 2 |
=========================== |
| 3 |
|
| 4 |
.. versionadded: 2.0.16 |
| 5 |
|
| 6 |
.. warning:: |
| 7 |
|
| 8 |
This feature only works with version 2.6.0 of Lasso and above |
| 9 |
|
| 10 |
Presentation |
| 11 |
------------ |
| 12 |
|
| 13 |
SAML federations are a list of Identity Providers or Service Providers which publish their metadata in a central point. |
| 14 |
Members of the federation can then easily download and use the full metadata file to connect to any party of the federation. |
| 15 |
|
| 16 |
Well known federations are `Renater <https://www.renater.fr/>`_ and `EduGain <https://edugain.org/>`_. |
| 17 |
|
| 18 |
Note that in previous LemonLDAP::NG versions, the way to handle federations was to import the entire federation into the LemonLDAP::NG configuration. |
| 19 |
This caused several issues: |
| 20 |
|
| 21 |
* The configuration JSON objects grows very large, sometimes beyond storage limitations |
| 22 |
* The memory consumption is very high |
| 23 |
* The manager interface becomes crowded with service definitions that are very rarely use |
| 24 |
|
| 25 |
Now LL::NG works with a separated federation metadata file, and provide the possibility to override some settings in its configuration. |
| 26 |
|
| 27 |
Configuration |
| 28 |
------------- |
| 29 |
|
| 30 |
Declare your SAML federation files |
| 31 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 32 |
|
| 33 |
You need to use the provided ``downloadSamlMetadata`` script to periodically download |
| 34 |
the federation metadata on each portal server. This script checks if the |
| 35 |
received metadata is valid, and ensures the metadata file does not contain |
| 36 |
partial content during download. |
| 37 |
|
| 38 |
.. code:: |
| 39 |
|
| 40 |
downloadSamlMetadata -m http://path/to/main-sps-renater-metadata.xml \ |
| 41 |
-o /etc/lemonldap-ng/metadata/main-sps-renater-metadata.xml |
| 42 |
|
| 43 |
|
| 44 |
Then, declare your federation metadata files in |
| 45 |
|
| 46 |
SAML2 Service » Advanced » Federation » SAML Federation Metadata files |
| 47 |
|
| 48 |
You should list local file paths, separated by spaces. For example :: |
| 49 |
|
| 50 |
/etc/lemonldap-ng/metadata/main-all-edugain-metadata.xml /etc/lemonldap-ng/metadata/main-sps-renater-metadata.xml |
| 51 |
|
| 52 |
In case an EntityID is defined in multiple files, the first match wins. |
| 53 |
|
| 54 |
Configure template IDP/SPs |
| 55 |
^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 56 |
|
| 57 |
SAML metadata does not contain all the information LemonLDAP::NG needs. It is |
| 58 |
recommended that you create a generic configuration for all the providers found |
| 59 |
in federation metadata. |
| 60 |
|
| 61 |
In order to do this: |
| 62 |
|
| 63 |
* Add a new SAML2 Service provider (or IDP) |
| 64 |
* Leave the *Metadata* content empty |
| 65 |
* Set *Options* » *Federation* » *Entity Identifier* to the Name= attribute of the federation. (eg: ``https://federation.renater.fr/``) |
| 66 |
|
| 67 |
All options set on this *special* provider will be applied to SPs (or IDPs) defined in the Renater federation |
| 68 |
|
| 69 |
In the case of Service Providers, Federation Metadata files contain a list of attributes that the SP wishes to receive. These attributes can be flagged as optional or mandatory (``isRequired="true"``). |
| 70 |
|
| 71 |
LemonLDAP::NG lets you decide what to do with these attributes: |
| 72 |
|
| 73 |
* *Keep*: The attribute definition from federation metadata will be handled by LemonLDAP::NG |
| 74 |
* *Make optional*: The attribute will be handled by LemonLDAP::NG, but made optional if it was mandatory |
| 75 |
* *Ignore*: The attribute will never be sent to this SP |
| 76 |
|
| 77 |
You can also define additional attributes to be sent in the *Exported Attributes* section. In case of a conflict between an attribute definition in federation metadata and an explicit definition in LemonLDAP::NG configuration, the LemonLDAP::NG configuration wins. |
| 78 |
|
| 79 |
Configure specific IDP/SPs |
| 80 |
^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 81 |
|
| 82 |
You may want to override the federation-wide defaults for some specific |
| 83 |
SP/IDPs. A common example is the Renater test SP that defines all its |
| 84 |
attributes as mandatory. Or you might want to disable AuthnRequest signature |
| 85 |
validation for some SPs |
| 86 |
|
| 87 |
To do this: |
| 88 |
|
| 89 |
* Add a new SAML2 Service provider (or IDP) |
| 90 |
* Leave the *Metadata* content empty |
| 91 |
* Set *Options* » *Federation* » *Entity Identifier* to the entityID of the provider you want to override |
| 92 |
* Set the desired configuration options on this provider |
| 93 |
|
| 94 |
Configure SAML attributes |
| 95 |
^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 96 |
|
| 97 |
Federation metadata files contains information about attributes required or |
| 98 |
simply requested by federated service providers (SP). In order for those |
| 99 |
attributes to be successfully sent to providers, they must exist in the |
| 100 |
LemonLDAP::NG session, under the same name as the FriendlyName declared in |
| 101 |
metadata. |
| 102 |
|
| 103 |
For example, the following attribute definition:: |
| 104 |
|
| 105 |
<md:RequestedAttribute |
| 106 |
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" |
| 107 |
Name="urn:oid:0.9.2342.19200300.100.1.1" |
| 108 |
FriendlyName="uid" isRequired="true"/> |
| 109 |
|
| 110 |
requires an ``uid`` attribute in the session. Make sure you configure your |
| 111 |
exported variables accordingly, and use macros to fill the gaps if needed. |
| 112 |
|
| 113 |
Subject ID |
| 114 |
---------- |
| 115 |
|
| 116 |
.. versionadded:: 2.17 |
| 117 |
|
| 118 |
Some SAML SPs can now use a ``subject-id`` attribute instead of a NameID or |
| 119 |
``eduPersonTargetedID`` (not supported in LemonLDAP::NG). |
| 120 |
|
| 121 |
In order to provide a ``subject-id`` attribute, you must create a macro with |
| 122 |
|
| 123 |
* Key: ``subjectId`` |
| 124 |
* Value: ``subjectid($uid, "scope.edu", "myrandomsalt1")`` |
| 125 |
|
| 126 |
The ``subject-id`` attribute will only be sent if the SP metadata contains the |
| 127 |
``urn:oasis:names:tc:SAML:profiles:subject-id:req`` extension with a value of |
| 128 |
``any`` or ``subject-id`` |
| 129 |
|
| 130 |
eduPersonTargetedID |
| 131 |
------------------- |
| 132 |
|
| 133 |
If a SP declares that it wants an ``eduPersonTargetedID`` attribute, |
| 134 |
LemonLDAP::NG will automatically configure the default NameID format to |
| 135 |
*persistent* and will emit both a *persistent* NameID, and an |
| 136 |
``eduPersonTargetedID`` attribute that contains this NameID. |
| 137 |
|
| 138 |
If the SP requests a NameID format other than *persitent*, the |
| 139 |
``eduPersonTargetedID`` attribute will *not* be sent. You might need to create |
| 140 |
a per-SP configuration and set the *Force NameID format* option to work around |
| 141 |
this. |