SAML SP configuration for the Loginapp REST API

This article explains how to configure the SAML SP.

Structure of the configuration

The SP configuration consists of the following parts:



Key store files

The key store and password files are used to securely store the key pairs used by the SP to sign and encrypt SAML messages.

Metadata file

The SAML metadata file contains information about the SP in a standardized XML format. It is made available to the service providers.

Extended metadata file

The extended SAML metadata file contains additional information in an XML file. It is not shared with the identity provider.

other SAML settings

Other SAML settings are part of the IAM configuration and can be edited using the Config Editor.

SP metadata file (sp.xml)

The SP metadata file (usually sp.xml) contains all standardized information about the SP. It contains public keys, SAML endpoints (URLs), supported SAML bindings, and encryption/signing preferences.

It may be given to any trusted identity provider that wants to integrate with the SP.

The transfer of the sp.xml to the IDP must be authentic, i.e., the IDP must be sure the file belongs to the actual and trusted SP.

The following XML template file may be used as starting point.

The SAML SP endpoint URLs have been introduced with IAM 7.7. Old endpoints are still supported so that SSO and SLO integrations with existing IDPs will continue working without reconfiguring the Loginapp UI.

Show moreShow lesscopy
<EntityDescriptor entityID="" xmlns="urn:oasis:names:tc:SAML:2.0:metadata">
	<SPSSODescriptor AuthnRequestsSigned="true" WantAssertionsSigned="true"

		<KeyDescriptor use="signing">
			<ds:KeyInfo xmlns:ds="">

		<KeyDescriptor use="encryption">
			<ds:KeyInfo xmlns:ds="">
			<EncryptionMethod Algorithm="">
				<KeySize xmlns="">128</KeySize>

		<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
			ResponseLocation="" />

		<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
			ResponseLocation="" />


		<AssertionConsumerService index="0" isDefault="1"
			Location="" />

  1. Configuring the sp.xml
  2. Copy the SP metadata template file to the SAML directory.
  3. copy
    cp sp.xml instances/auth/saml/ 
  4. entityID (XML attribute)
    The EntityDescriptor's attribute entityID can be chosen freely but it must be unique among all parties taking part in the single sign-on (IDP and all SPs). Often, the public URL of the SP is used as its entityID. In our examples, we use the entity ID
    The entityID must be identical in the SP metadata file, the SP extended metadata file, and the Airlock IAM configuration.
  5. ds:X509Certificate (XML tags)
    Replace the certificate data  (the chunk of base-64 data MIICujCC ... PurUaXZz) with the certificate of the configured key store. The same certificate may be used for both signing and encryption though for production environments it is recommended to use two different certificates.
  6. URLs (various XML attributes)
    Replace all URLs in the files starting with with the URL of your Loginapp as seen from the browser. This is usually the entry path of the IAM mapping on the Airlock Gateway.
  7. The SP metadata template assumes that your SP supports both POST- and Artifact-Binding. To disable either of the bindings (and thus enforce the other), remove or comment out the corresponding SingleSignOnService-Tag at the bottom of the file. The Artifact-Binding is denoted by HTTP-Redirect.

Note that the sp.xml file must comply with the XML schema as specified in

SP extended metadata file (sp-extended.xml)

The SP extended metadata file (usually sp-extended.xml) contains IAM-specific information and must not be given to the identity provider unless the identity provider is an Airlock IAM as well.

The following XML template file may be used as starting point.

Show moreShow lesscopy
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<EntityConfig xmlns="urn:sun:fm:SAML:2.0:entityconfig" xmlns:fm="urn:sun:fm:SAML:2.0:entityconfig"
	hosted="true" entityID="sp1">

	<SPSSOConfig metaAlias="/iamSp">
		<Attribute name="signingCertAlias">
		<Attribute name="encryptionCertAlias">
		<Attribute name="spAuthncontextClassrefMapping">
		<Attribute name="spAuthncontextComparisonType">
		<Attribute name="wantAssertionEncrypted">
		<Attribute name="wantPOSTResponseSigned">
		<Attribute name="wantArtifactResponseSigned">
		<Attribute name="wantLogoutRequestSigned">
		<Attribute name="wantLogoutResponseSigned">
		<Attribute name="cotlist">
		<Attribute name="useNameIDAsSPUserID">
  1. Configuring the sp-extended.xml
  2. Copy the sp extended metadata template file to the SAML directory.
  3. copy
    cp sp-extended.xml instances/auth/saml/  
  4. entityID (XML attribute)
    The entityID must be exactly the same as in the SP metadata file.
  5. Set the signingCertAlias and encryptionCertAlias to the respective aliases in the certificate key store.
    • If you don’t use encryption, you can leave the latter empty.
    • To check whether the alias is the right one, you may use the following command (using the Java key tool utility):
    keytool -exportcert -keystore saml-keystore.jks -alias your-alias -rfc
  6. Set the cotlist attribute to exactly the same value as in idp-extended.xml (e.g. "iam")
  7. want*Signed/Encrypted attributes: If you want the IDP to sign and/or encrypt certain specific elements in the Assertion, specify it here to enforce it but don’t forget to also configure it on the IDP so that the Assertions are really issued that way.
  8. Leave all other attributes unchanged as they configure various important plugin classes.

SP settings (Config Editor)

  1. To complete the SP configuration, open the IAM Config Editor and perform the following steps:
  2. Go to:
    Loginapp >> SAML Settings >> Service Provider Settings (Flow Auth)
  3. Create end edit a new SAML 2.0 Flow SP plugin in the SAML 2.0 Service Providers list
  4. Add or fill in the SP Entity Config:
    • Create or edit the SAML 2.0 Service Provider Entity plugin:
      • SP Entity ID: Use the same value as used in the metadata files above. In our example, we used the value
      • Metadata File: point to the IDP metadata file. Example: instances/auth/saml/sp.xml
      • Extended Metadata File: point to the extended IDP metadata file. Example: instances/auth/saml/sp-extended.xml
    • To fill in the IdP Entity Settings see Adding SAML IDP to the SP configuration for the Loginapp REST API
    • Optionally configure the Username Transformation property. This username transformation will be executed before the username transformations configured in the authentication flow and it can be configured to interrupt the transformation chain. This may be useful to support both local login and SAML SSO with the same authentication flow.
    • Optionally configure SP-initiated SSO Settings to select a particular binding or to add additional extension to the authentication request.
    • Optionally configure IdP-initiated SSO Settings to explicitly select a target application of the IdP-initiated SSO use case.
  5. Optionally configure Use Single-Logout (SLO) Behaviour. If this option is set (Default) the SP will inform the IDP when its logout URL is called. If this option is not set, the logout is only processed locally.

This is sufficient for the SAML SP to work. As the next step, a SAML IDP must be configured for this SP.

All advanced configuration options are covered in separate articles or described in the Config Editor.

Federation settings (Config Editor)

  1. The federation settings affect both the IDP and the SPs and are configured in a separate plugin:
  2. Go to:
    Loginapp >> SAML Settings >> SAML Federation Settings (create plugin if required)
  3. Set the plugin SAML XML Signature Provider in property XML Signature Keystore Provider and configure it as follows:
    • Keystore: refer to the key store created earlier.
      In our example above, it is instances/auth/saml/saml-keystore.jks
    • Keystore Type: The type of the key store.
      In our example, choose the jks option.
    • Keystore Password File: The file containing the key store password.
      In our example, this is instances/auth/saml/.keystorepass
    • Keystore Private Key Password File: The file containing the private key password.
      In our example, this is instances/auth/saml/.privatekeypass
  4. Set the Error Page URL to ui/app/error/message.

Defining the target Target Application for the SP

In this step, a target application is configured for the application accessed on the remote SP. It tells Airlock IAM how to use the remote IDP for authentication.

  1. To configure the target application for the SAML SP, do the following:
  2. Go to:
    Loginapp >> Applications and Authentication
  3. Add a new Target Application to the list of Applications and configure it as follows:
  4. Create a new Application ID.
  5. If suitable, configure an Application Selector (see also Flow-based authentication). This is not necessary if the SAML flow is started on the IDP (IDP-initiated SSO).
  6. Connect or create an Authentication Flow. To access the remote IDP's authentication flow.
    • Add the SAML 2.0 User Identifying Step as the only step in the list of Steps.
    • Optionally the authentication flow for SAML may be configured Persistency-less.
    • Optionally further steps may be added to the authentication flow. If the SP persists users, it is possible to add steps that require a persisted user (e.g. two-factor authentication).
  7. Optionally configure Identity Propagation. To use the attributes from the SAML assertion issued by the IDP you may configure a SAML 2.0 Identity Propagator.

If using Airlock IAM's SP-initiated login, do not forget to add a UI configuration for the target application. This is required so that the SAML SP will support the SAML protocols correctly.

See Using the Loginapp UI with SAML.

Note that the configured Target URI Resolver is ignored for SAML. The SAML implementation determines the target URI itself. In the case of IDP-initiated SSO, the URI defined in property Relay State URI (IdP-Initiated SSO) (in the SP configuration, see above) is used.

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.