Adding SAML IDP to the SP configuration for the Loginapp REST API
This article explains how to add a remote identity provider (IDP) as part of the SP configuration.
For more information about configuring Airlock IAM as SAML IDP see SAML IDP setup with the Loginapp REST API.
The article is based on the first steps of the SAML SP setup.
Structure of the configuration
Adding an IDP to the SP configuration involves the following configuration parts:
Part | Purpose |
---|---|
Metadata file | The SAML metadata file contains information about the IDP in a standardized XML format. It is usually provided by the service provider. |
Extended metadata file | The extended SAML metadata file contains additional information about the remote IDP in an XML file. It is not provided by the service provider (unless the IDP is an Airlock IAM). |
SAML settings | The IDP configuration within the SP configuration in the IAM configuration (Config editor). |
Target application | A target application configuration for a protected backend application. This involves an authentication flow and an identity propagator suitable for SAML. |
IDP metadata file
The IDP metadata file contains all standardized information about the remote IDP. It contains public keys, SAML endpoints (URLs), supported SAML bindings, and encryption/signing preferences.
The file should be provided by the identity provider.
The transfer of the IDP metadata file to the SP must be authentic, i.e., before using it, you must make sure it really belongs to the remote IDP. Failing to do so, may result in severe security flaws.
If the remote IDP does not provide you with a ready-to-use metadata file but only the relevant data (URLs, public keys, etc.) you may use the following template file to create a valid metadata file.
Configuration instructions
- Copy the remote IDP metadata template file to the SAML directory.
- Remember the entityID of the remote IDP. It is required for the next two steps.
In this example, we usehttps://remote-idp.com/auth/saml/
as entity ID.
IDP extended metadata file
The extended metadata file contains IAM-specific information and is not provided by the IDP unless the IDP is an Airlock IAM as well.
To create the extended IDP metadata file, the following XML template file may be used as starting point.
Configuring the IDP extended metadata file (remote-idp-extended.xml)
- Copy the IDP extended metadata template file to the SAML directory and name it such that it is clearly associated with the remote IDP's metadata file from the previous step.
cp idp-extended-template.xml instances/auth/saml/
remote-idp-extended.xml entityID
(XML attribute)
The entityID must be exactly the same as in the SP metadata file.
In our example:https://remote-idp.com/auth/saml/
hosted
(XML attribute)
Thehosted
attribute in the elementEntityConfig
must be set to 0 orfalse
.cotlist
(XML attribute)
The cotlist attribute defines the name of the circle of trust to be used. All parties participating in the single sign-on must use the same circle of trust.idpAuthncontextClassrefMapping
(XML attribute)
The idpAuthncontextClassrefMapping defines a list of authentication contexts that the SP will request the IDP to provide. Based on this request, the IDP chooses an appropriate authentication flow that meets the requirements. See Authentication context classes in the SAML IDP for more details.- Signing and encryption preferences (various XML attributes)
There are various attributes defining the requirements of the remote IDP regarding signing and encrypting SAML messages. The remote IDP should provide this information. If the information is not available, try using the values of the above template.
Adding the remote IDP to the SP settings (Config Editor)
To add the remote IDP to the SP settings, open the IAM Config Editor and perform the following steps.
- Go to:
Loginapp >> SAML Settings >> Service Provider Settings (Flow Auth) - Open the SAML 2.0 Flow SP plugin from the list of SAML 2.0 Service Providers and configure it as follows.
- As IdP Entity Settings, add a new SAML 2.0 Identity Provider Entity plugin with the following values:
- IdP Entity ID: Use the same value as used in the metadata files above. In our example, we used the value
https://remote-idp/auth/saml
. - Metadata File: point to the IDP metadata file. Example:
instances/auth/saml/idp.xml
- Extended Metadata File: point to the extended IDP metadata file. Example:
instances/auth/saml/idp-extended.xml
- IdP Entity ID: Use the same value as used in the metadata files above. In our example, we used the value
- Information about RequestedAuthnContext to Flow Application ID can be found in Authentication context classes in the SAML IDP.
- Specified in Relay State URI (IdP-Initiated SSO) is used as SAML relay state for IDP-initiated SSO: it tells the SP where to redirect the browser to after verifying the SAML assertion.
- The Attribute Settings property allows including additional information in the SAML assertion. Use the Config Editor to choose from a large set of elements such as UserID, language, context data, roles, client IP address, and more.
Configuration hints
- Activate the configuration to make the changes effective.
- Make sure to use an up-to-date Airlock Gateway mapping template file and activate the SAML allow rule.
If any of the SAML metadata files are changed, a restart of the IAM instance may be necessary.