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:
-
Go to http:/serveraddress:serverport/libs/granite/security/content/truststore.html
-
Press the Create TrustStore link
-
Enter the password for the TrustStore and press Save.
-
Click on Manage TrustStore.
-
Upload the IdP certificate.
-
Take note of the certificate Alias. The alias is admin#1436172864930 in the example below.
Add the Service Provider key and certificate chain to the AEM keystore
com.adobe.granite.keystore.KeyStoreNotInitialisedException: Uninitialised system trust store
- Go to: http://localhost:4502/libs/granite/security/content/useradmin.html
- Edit the
authentication-service
user. - Create a KeyStore by clicking Create KeyStore under Account Settings.
-
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
-
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
-
Upload the Private key file by clicking Select Private Key File.
-
Upload the certificate file by clicking Select Certificate Chain Files.
-
Assign an Alias, as shown below:
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:
-
Going to the Web Console, at http://localhost:4502/system/console/configMgr
-
Search for and click the entry called Apache Sling Logging Logger Configuration
-
Create a logger with the following configuration:
- Log Level: Debug
- Log File: logs/saml.log
- Logger: com.adobe.granite.auth.saml