SAML authentication failures and 500 errors due to misnamed configuration files
This article describes how to address SAML authentication failures and HTTP 500 errors in Adobe Experience Manager (AEM) that occur when the SAML Authentication Handler configuration file is misnamed and not recognized by the system.
Description description
Environment
Adobe Experience Manager (AEM) Managed Services (all versions)
Issue/Symptoms
- You encounter a 500 error after logging in via your Identity Provider and are redirected back to the
/saml_loginendpoint. - SAML authentication fails on AEM Publish instances.
- The Identity Provider POST to
/saml_loginreaches AEM but is not handled by the SAML Authentication Handler. - Error message in logs: PreconditionViolatedPersistenceException: Resource at ‘/saml_login’ is not modifiable.
Cause
This issue occurs when the SAML Authentication Handler configuration file is misnamed. If the configuration file does not follow the required factory PID naming convention, the OSGi Installer does not recognize it, resulting in the SAML Authentication Handler not being activated. As a result, SAML login requests are not processed correctly, leading to authentication failures and 500 errors.
Resolution resolution
To fix the SAML authentication failures and 500 errors, follow these steps:
-
Connect to your AEM instance and navigate to the
/apps/system/configdirectory. -
Identify all SAML Authentication Handler configuration files, such as those containing
SamlAuthenticationHandler. -
Verify the naming of the configuration files. The correct format for the factory configuration file is:
com.adobe.granite.auth.saml.SamlAuthenticationHandler <unique-name>.cfg.json -
Remove or rename any incorrectly named or legacy configuration files, such as:
SamlAuthenticationHandler..cfg.jsonSamlAuthenticationHandler..config
-
Ensure only the correctly named configuration file is present in
/apps/system/config. The file should contain all required SAML properties, such asidpUrl. -
Access the AEM Web Console at
/system/console/osgi-installerand confirm that the configuration is recognized under the factory PIDcom.adobe.granite.auth.saml.SamlAuthenticationHandler. -
Verify that the SAML Authentication Handler is active in the OSGi console.
-
Test SAML authentication by logging in through your Identity Provider, and confirm that users no longer receive a 500error and can access the application.
-
Update your deployment source to include only the correctly named configuration file and remove obsolete or duplicate configurations to prevent future issues.
-
After redeployment or restart, monitor the system to ensure SAML authentication remains active and functional.