Add the IdP Certificate to the AEM TrustStore

SAML assertions are signed and may optionally be encrypted. In order for this to work you have to provide at least the public certificate of the IdP in the repository. To do this you need to:

  1. Go to http:/serveraddress:serverport/libs/granite/security/content/truststore.html

  2. Press the Create TrustStore link

  3. Enter the password for the TrustStore and press Save.

  4. Click on Manage TrustStore.

  5. Upload the IdP certificate.

  6. Take note of the certificate Alias. The alias is admin#1436172864930 in the example below.

    chlimage_1-372

Add the Service Provider key and certificate chain to the AEM keystore

NOTE
The below steps are mandatory, otherwise the following exception will be thrown: com.adobe.granite.keystore.KeyStoreNotInitialisedException: Uninitialised system trust store
  1. Go to: http://localhost:4502/libs/granite/security/content/useradmin.html
  2. Edit the authentication-service user.
  3. Create a KeyStore by clicking Create KeyStore under Account Settings.
NOTE
The below steps are required only if handler should be able to sign or decrypt messages.
  1. Create the certificate/keypair for AEM. The command to generate it via openssl should resemble the example below:

    openssl req -newkey rsa:2048 -new -x509 -days 3652 -nodes -out certificate.crt -keyout key.pem

  2. Convert the key to PKCS#8 format with DER encoding. This is the format required by the AEM keystore.

    openssl pkcs8 -topk8 -inform PEM -outform DER -in key.pem -out key.der -nocrypt

  3. Upload the Private key file by clicking Select Private Key File.

  4. Upload the certificate file by clicking Select Certificate Chain Files.

  5. Assign an Alias, as shown below:

    chlimage_1-373

Configure a Logger for SAML

You can set up a Logger to debug any issues that might arise from misconfiguring SAML. You can do this by:

  1. Going to the Web Console, at http://localhost:4502/system/console/configMgr

  2. Search for and click the entry called Apache Sling Logging Logger Configuration

  3. Create a logger with the following configuration:

    • Log Level: Debug
    • Log File: logs/saml.log
    • Logger: com.adobe.granite.auth.saml

Experience Manager