It was 8:00 AM on a Monday morning when PagerDuty screamed. Over 200 content authors across three continents were locked out of our Adobe Experience Manager (AEM) production author environment. They weren't getting a polite "Invalid Password" message; they were trapped in a violent, high-speed infinite 302 redirect loop between AEM and our Azure AD Identity Provider (IdP). The network tabs were flooded with hundreds of requests per second, entirely taking down authoring productivity for the morning. The culprit? A seemingly harmless 90-second clock drift between the AEM Linux servers and the IdP, combined with an overly strict NotBefore condition in the SAML assertion. Because we hadn't configured the clockTolerance OSGi property, AEM aggressively rejected the assertions as "future-dated," trashing the login attempt, and blindly throwing the unauthenticated user back to the IdP, which immediately threw them back to AEM because they were already authenticated there. If your enterprise treats AEM authentication as a checkbox integration rather than a core architectural pillar, you are one clock-skew or bad cookie forward away from a major production incident.
This exhaustive guide covers the entire AEM authentication ecosystem from the ground up to ensure you never face a similar outage. We will dissect the Apache Sling authentication pipeline, trace the exact cryptographic behavior of the Token Authentication Handler, and configure the Granite SAML 2.0 Authentication Handler for bulletproof single sign-on (SSO). We will explore automated user and group synchronization using Jackrabbit Oak, write immutable RepoInit scripts for service users, and map out the specific Dispatcher configurations required to securely route and cache SSO traffic. Furthermore, we will dive into LDAP integration as a robust alternative to SAML, and we will confront the paradigm shift in AEM as a Cloud Service where Adobe IMS completely replaces local IdP federation on the Author tier. Finally, we will arm you with advanced debugging tactics for signature mismatches, audience restrictions, and NameID failures using SAML tracer tools.
Before re-architecting your identity flows, ensure you have a firm grasp of the foundational concepts discussed in my AEM Security, Users, Groups, and ACLs Complete Guide and understand how system states are managed via my OSGi in AEM Complete Guide. For routing and caching implications—which are often the root cause of broken SSO—review the AEM Dispatcher The Complete Guide. If you are operating in modern infrastructure, refer to the AEM Cloud Service Complete Guide.
How Sling Authentication Works
At its most fundamental level, Adobe Experience Manager relies entirely on the Apache Sling framework for handling incoming HTTP requests. The Sling Authentication Service is the absolute gatekeeper; it evaluates every single request before the resource resolver is even allowed to map a URL path to a JCR node. Most teams get this wrong because they assume AEM handles logins like a standard Java web application. It does not.
When a request enters the Sling engine, the SlingAuthenticator orchestrates a chain of registered OSGi services that implement the AuthenticationHandler interface. This pipeline is highly extensible but requires precise configuration.
The evaluation happens in a strict sequence:
- Extraction: Every registered authentication handler gets an opportunity to inspect the incoming HTTP request. They look for specific credentials—a session cookie, an HTTP Basic authentication header, an OAuth bearer token, or a raw SAML assertion POST payload.
- AuthenticationInfo Generation: If a handler successfully extracts credentials, it returns an
AuthenticationInfoobject. This object contains the user's raw credentials, the target workspace, and hints about the authentication type. - JCR Login: Sling takes this
AuthenticationInfoand passes it to the underlying JCR repository (Apache Jackrabbit Oak). Oak'sLoginModulechain then validates the credentials. - Session Binding: If Oak validates the credentials, a valid JCR Session is created and bound to the current Sling HTTP request. The request is now "authenticated."
If no handler can extract credentials, Sling checks its internal access control lists to see if the requested path permits anonymous access. If anonymous access is denied, Sling invokes the requestCredentials method on all available handlers. This is the exact moment an unauthenticated request is converted into an HTTP 302 redirect sending the user to a custom login form or an external Identity Provider.
The Token Authentication Handler
Once a user is successfully authenticated via a heavy protocol like SAML or LDAP, AEM does not want to force a re-authentication against the external system on every single subsequent request. That would destroy performance and likely trigger rate limits at the IdP. Instead, AEM relies on the com.day.crx.security.token.impl.TokenAuthenticationHandler.
The Token Authentication Handler intercepts the successful authentication event and issues a lightweight, cryptographically secure "Login Token" to the user's browser.
Cookie Mechanics and HMAC Encryption
By default, this token is stored in a cookie named login-token.
When the token is generated, AEM performs a series of cryptographic operations. It combines the user's JCR node ID, an expiration timestamp, and other metadata, and signs it using an HMAC (Hash-based Message Authentication Code). The secret key used for this HMAC signature is stored directly in the JCR repository, typically at /rep:security/rep:authorizables/rep:users/a/admin/rep:token.key.
Because this key is unique to the AEM instance (or clustered repository), a login-token generated on Author Server A is fundamentally invalid on Author Server B unless they share the same backend Oak repository. This is why sticky sessions are notoriously problematic if load balancers aren't configured perfectly.
Token Expiry and Revocation
The Token Authentication Handler OSGi configuration dictates the lifespan of this cookie. The default is often set to a session-based lifecycle, but enterprise security policies typically mandate a hard expiry (e.g., 12 hours).
- Validation: On every subsequent request, the Token Authentication Handler reads the
login-tokencookie. It recalculates the HMAC using the repository's secret key. If the signature matches and the timestamp is not expired, it instantly creates theAuthenticationInfoobject, completely bypassing the original SAML or LDAP handler. - Invalidation: When a user explicitly logs out, AEM actively revokes the token. It removes the cryptographic material associated with that specific token from the user's JCR node (under
/rep:token) and instructs the browser to clear thelogin-tokencookie.
SAML 2.0 Integration Architecture
Security Assertion Markup Language (SAML) 2.0 is an XML-based protocol for exchanging authentication and authorization data between an Identity Provider (IdP) and a Service Provider (SP). In our context, Azure AD, Okta, PingIdentity, or ADFS acts as the IdP, and AEM acts as the SP.
Core SAML Concepts
To debug SAML, you must understand the terminology:
- Entity ID: A unique string identifying the SP or IdP. AEM needs an Entity ID (e.g.,
https://author.mysite.com) and the IdP provides one as well. - Assertion Consumer Service (ACS) URL: The specific AEM endpoint that receives the SAML Response. This is heavily restricted by the IdP to prevent token hijacking.
- SAML Response: The XML payload sent from the IdP to AEM via an HTTP POST. It contains the Assertion.
- Assertion: The signed XML document inside the Response that guarantees the user's identity, timestamp validity, and attribute claims (Name, Email, Groups).
- NameID: The primary identifier for the user in the assertion. This maps directly to the AEM username (rep:principalName).
SP-Initiated vs IdP-Initiated Flows
Understanding the exact HTTP flow is critical because different configurations break different flows.
SP-Initiated SSO:
The user navigates to an AEM URL first. AEM realizes the user is unauthenticated, the SAML handler's requestCredentials fires, and the browser is redirected to the IdP.
User Dispatcher AEM Author IdP (Azure/Okta)
| | | |
|-- GET /aem/start ---------->| | |
| |-- GET /aem/start -------->| |
| | |-- HTTP 302 Redirect -------->|
|<--------------------------------------------------------| |
| | | |
|-- GET /login ------------------------------------------------------------------------->|
| | | |
|<-- Auth Prompt (MFA) ------------------------------------------------------------------|
|-- Provide Credentials ---------------------------------------------------------------->|
| | | |
|<-- HTTP 200 (HTML auto-posting form with SAMLResponse & RelayState) -------------------|
| | | |
|-- POST /saml_login ------------------------------------>| |
| | | (Validates XML Signature, |
| | | checks clock drift, syncs |
| | | user, creates login-token) |
|<-- HTTP 302 Redirect (to RelayState URL) + Set-Cookie: login-token --------------------|
| | | |
|-- GET /aem/start (with cookie) ------------------------>| |IdP-Initiated SSO: The user logs into their corporate portal (e.g., Okta Dashboard) and clicks a tile labeled "AEM". The IdP immediately sends an HTTP POST with the SAML Response directly to AEM's ACS URL.
User IdP (Azure/Okta) AEM Author
| | |
|-- Clicks AEM App Tile --------------------------->| |
| |-- POST /saml_login ----->|
| | |
| | (Validates Assertion, |
| | issues login-token) |
|<-- HTTP 302 Redirect to defaultRedirectUrl + Set-Cookie: login-token --------|Notice that in the IdP-initiated flow, there is no RelayState telling AEM where the user wanted to go. AEM relies entirely on the defaultRedirectUrl OSGi property to send the user to a safe landing page.
The SAML 2.0 Authentication Handler
To integrate AEM with your enterprise SSO, you must configure the com.adobe.granite.auth.saml.SamlAuthenticationHandler. This handler translates the complex XML protocol into a simple AEM JCR login.
Do not configure this via the Web Console UI in production. This must be managed as an OSGi configuration deployed via your codebase. Here is the exhaustive, production-ready configuration reference with every property you need to care about:
| OSGi Property | Type | Description | Production Best Practice |
|---|---|---|---|
path | String[] | Repository paths where this handler is active. | Use ["/"] for blanket coverage on Author, or ["/content/my-site/secure"] for gated Publish content. |
idpUrl | String | The IdP's SSO URL where SAML AuthnRequests are sent. | Ensure this is the exact HTTP-Redirect or HTTP-POST URL from the IdP metadata. |
idpCertAlias | String | Alias of the IdP's public certificate in AEM's Global TrustStore. | e.g., okta-cert-2026. Update this before the IdP rotates their certs! |
idpHttpRedirect | Boolean | Send SP-initiated requests using HTTP Redirect (GET) instead of POST. | true. Almost all modern IdPs prefer HTTP Redirect for AuthnRequests. |
serviceProviderEntityId | String | The Entity ID identifying AEM. | Use a unique FQDN like https://author.mysite.com. Must match IdP exactly. |
assertionConsumerServiceURL | String | The explicit URL AEM tells the IdP to return the assertion to. | Optional. If left blank, AEM derives it from the incoming request. Force it if reverse proxies are messing up hostnames. |
spPrivateKeyAlias | String | Alias of AEM's private key in the user KeyStore. | Required only if your IdP mandates SP-signed AuthnRequests. |
keyStorePassword | String | Password for the KeyStore containing the SP key. | Encrypt this string in OSGi using AEM Crypto Support. Never use plaintext. |
defaultRedirectUrl | String | Fallback URL after login if no RelayState exists. | /aem/start.html for Author. |
userIDAttribute | String | SAML attribute name containing the username. | Leave blank to use the NameID. Otherwise specify a claim name like uid or email. |
nameIdFormat | String | The NameID format AEM expects in the Assertion. | urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress or unspecified. |
useEncryption | Boolean | Expects the entire SAML assertion to be encrypted by the IdP. | false. Rely on TLS (HTTPS) for transport security. XML encryption kills CPU. |
createUser | Boolean | Auto-create JCR users upon successful login. | true. If false, new users will authenticate but instantly get 403 Forbidden. |
addGroupMemberships | Boolean | Add user to AEM groups based on SAML attributes. | true if governing AEM permissions via Azure/Okta AD groups. |
groupMembershipAttribute | String | SAML attribute name containing group list. | e.g., groups or http://schemas.microsoft.com/ws/2008/06/identity/claims/groups. |
defaultGroups | String[] | Groups assigned to every successfully authenticated user. | ["contributor"] or a baseline custom group. |
synchronizeAttributes | String[] | Maps IdP claims to JCR properties. | ["givenName=profile/givenName", "mail=profile/email"] |
clockTolerance | Integer | Seconds of time drift allowed between IdP and AEM servers. | 60. This is the most critical setting to prevent random authentication failures. |
handleLogout | Boolean | Enable SAML Single Logout (SLO). | true. Allows AEM to notify the IdP when a user logs out. |
logoutUrl | String | The IdP's Single Logout endpoint. | Must match the SLO URL in the IdP metadata. |
digestMethod | String | Algorithm for XML signature digests. | http://www.w3.org/2001/04/xmlenc#sha256. Do not use SHA-1. |
signatureMethod | String | Algorithm for XML signatures. | http://www.w3.org/2001/04/xmldsig-more#rsa-sha256. |
Configuring Keystores and Truststores
For the SAML handler to validate the cryptographic signature on the XML payload, AEM must have access to the public certificates. This is managed through Granite KeyStores and TrustStores.
The Global TrustStore
The TrustStore holds the public certificates of third parties you trust (the IdP).
- Go to Tools -> Security -> Trust Store.
- Create the TrustStore and set a strong password.
- Import the IdP's Base64 X.509 certificate (downloaded from Azure/Okta metadata).
- The system generates a Certificate Alias (e.g.,
truststore-12345). Rename it to something logical likeazure-ad-cert-2026. This exact string goes into theidpCertAliasOSGi property.
The Service User KeyStore
If your enterprise mandates SP-signed requests, AEM needs its own private key. Keystores in AEM are bound to specific JCR users. The SAML handler operates under the context of the authentication-service system user.
- Go to Tools -> Security -> Users. Search for the
authentication-serviceuser. - Open properties, navigate to the Keystore tab.
- Create the Keystore and set a password (this password goes into
keyStorePassword). - Import your PKCS#12 (.p12) or PEM private key/certificate pair.
- Note the alias, e.g.,
aem-sp-key. This goes intospPrivateKeyAlias.
User Sync and RepoInit
When the SAML handler validates an assertion and createUser is enabled, AEM provisions a new node in the JCR under /home/users/saml.
For AEM to possess the required ACLs to create users and assign groups on the fly, the internal authentication-service user must have elevated privileges. Out of the box, it does, but in hardened environments or custom deployments, this can break.
To guarantee your authentication system user has the required permissions, strictly enforce it via an OSGi RepoInit script deployed with your codebase. This ensures environments are entirely reproducible.
Add the following to your ui.config OSGi configurations (e.g., org.apache.sling.jcr.repoinit.RepositoryInitializer-saml.config):
scripts=[
"create service user authentication-service with path system/cq/core",
"set ACL for authentication-service",
" allow jcr:all on /home/users",
" allow jcr:all on /home/groups",
" allow jcr:read on /",
"end"
]Without these permissions, the SAML handler will successfully validate the XML payload, attempt to create the JCR user, fail with an AccessDeniedException internally, and present the user with a broken login screen.
LDAP Integration: The Alternative to SAML
While SAML handles identity federation via the browser, Lightweight Directory Access Protocol (LDAP) integrates AEM directly with a backend directory server (like Active Directory or OpenLDAP) over the network.
LDAP is rarely used for Author SSO anymore—SAML is vastly superior for browser-based security and MFA support. However, LDAP remains incredibly relevant for Intranet environments, syncing massive, complex AD group hierarchies into AEM via a scheduled background task rather than relying on just-in-time synchronization during a browser login.
Architecture of AEM LDAP Integration
Unlike SAML, which uses a single Sling Authentication Handler, LDAP integration in AEM utilizes three distinct OSGi components tied to Apache Jackrabbit Oak:
- The LDAP Identity Provider (
org.apache.jackrabbit.oak.security.authentication.ldap.impl.LdapIdentityProviderImpl): This component establishes the raw socket connection to the LDAP server (usually over LDAPS port 636). It defines the base DNs for users and groups, and the search filters used to find them. - The Default Sync Handler (
org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DefaultSyncHandler): This component dictates how the data is translated from the LDAP schema to the JCR schema. It maps LDAP attributes (likesAMAccountNameandmemberOf) to AEM properties, and controls the cache expiration for synced users. - The External Login Module (
org.apache.jackrabbit.oak.spi.security.authentication.external.impl.ExternalLoginModuleFactory): This plugs into the Jackrabbit Oak login pipeline. When a user enters credentials on the AEM login screen, this module reaches out to the LDAP Identity Provider, attempts an LDAP bind with the provided credentials, and if successful, triggers the Sync Handler to update the JCR profile.
Setting up LDAP
If you must implement LDAP, configure the LDAP Identity Provider OSGi config meticulously:
provider.name: A unique identifier (e.g.,active-directory).host.name/host.port: The domain controller's address. Use port 636 and enablehost.ssl.bind.dn/bind.password: The service account credentials AEM uses to query the directory.user.baseDN: Where to search for users (e.g.,OU=Employees,DC=mysite,DC=com).user.idAttribute: The AD attribute matching the login name (usuallysAMAccountName).
You must then link the External Login Module to this provider by setting its idp.name to match the provider.name, and binding it to the sync.handlerName of your configured Sync Handler.
Dispatcher Configuration for SSO
Identity integrations are completely useless if your CDN and web server cache the responses incorrectly. The AEM Dispatcher sits in front of the publisher (and often the author), meaning it mediates all SAML traffic.
1. Allow Authentication Headers and Cookies
By default, the Dispatcher strips sensitive headers to ensure high cache hit ratios. For SSO to work, you must instruct the Dispatcher to pass the login-token cookie back to AEM, and pass the HTTP Authorization headers.
In your dispatcher.any (or clientheaders.any), ensure you have:
/clientheaders {
"Authorization"
"Cookie"
"Set-Cookie"
"Referer"
}2. Permit the SAML POST Endpoint
The IdP sends the SAML Response as an HTTP POST to /saml_login. By default, Dispatcher blocks POST requests to root paths. You must add a specific filter rule to allow it.
In your /filter section:
/0050 { /type "allow" /method "POST" /url "/saml_login" }3. Permission Sensitive Caching (AuthChecker)
If you are using SAML on the Publish tier for gated content (e.g., a Partner Portal behind a Closed User Group), you face a massive challenge: How do you cache HTML pages in the Dispatcher while ensuring only authenticated users can see them?
The answer is the auth_checker.
When a user requests a cached protected page, the Dispatcher pauses the delivery. It strips the URL path, forwards the user's headers (including the login-token cookie) in a lightweight HEAD request to an AEM endpoint (like /bin/permissioncheck).
- If AEM returns
200 OK, Dispatcher serves the cached HTML. - If AEM returns
401or403, Dispatcher denies the request, forcing the user to log in.
/auth_checker {
/url "/bin/permissioncheck"
/filter {
/0000 { /glob "*" /type "deny" }
/0001 { /glob "/content/mysite/secure/*" /type "allow" }
}
/headers {
/0000 { /glob "*" /type "deny" }
/0001 { /glob "Set-Cookie:*" /type "allow" }
}
}AEM as a Cloud Service (AEMaaCS) and Adobe IMS
If you are migrating from AEM 6.5 to AEM as a Cloud Service (AEMaaCS), throw away everything you know about configuring SAML on the Author tier.
AEM as a Cloud Service completely fundamentally alters the identity landscape. You are no longer permitted to install the Granite SAML Authentication Handler on the Author service. Instead, Adobe mandates the use of the Adobe Identity Management System (IMS).
The IMS Paradigm
- Centralized Federation: Instead of federating AEM directly to Azure AD, you federate your Azure AD into the Adobe Admin Console using SAML 2.0 or OIDC.
- Adobe Profiles: Users log into the Adobe Cloud ecosystem (via
adobe.com). - Product Profiles as Groups: Inside the Adobe Admin Console, you create "Product Profiles" (e.g.,
AEM-Authors,AEM-Approvers). - Automated Sync: AEMaaCS has native, internal integration with IMS. It pulls the users and their Product Profile mappings directly from the IMS infrastructure.
In AEMaaCS, local AEM groups (like contributors) are mapped to IMS Product Profiles. When a user successfully authenticates against Adobe IMS and hits the Author environment, their JCR user is instantly updated with the group memberships defined in the cloud console.
Important Caveat: While Author tier SAML is dead, Publish tier SAML is alive and well. If you host a gated extranet for external customers on your AEMaaCS publishers, you will still configure the Granite SAML Handler exactly as described in this guide for your Publish runmodes.
Debugging SAML and SSO Failures
When SSO breaks, it rarely gives you a clear error message. You have to hunt down the failure in the error.log and the network tab. Enable TRACE logging for com.adobe.granite.auth.saml via the Sling Log Support console immediately.
The Infinite 302 Redirect Loop
Symptom: The browser rapidly flickers between AEM and the IdP, eventually stopping with a "Too Many Redirects" browser error.
Cause: The SAML handler is successfully validating the assertion and issuing a login-token cookie. It then redirects the user to the defaultRedirectUrl. However, when the browser requests that URL, the login-token cookie is either missing, dropped by Dispatcher, or rejected by AEM. Sling sees an unauthenticated request, triggers requestCredentials, and kicks the user back to the IdP. Since they are already logged into the IdP, the IdP instantly posts a new assertion back to AEM. The cycle repeats endlessly.
Resolution:
- Inspect the browser Network tab. Check the
Set-Cookieheader on the/saml_loginresponse. Is the domain correct? If your load balancer is onauthor.mysite.combut AEM thinks its hostname islocalhost, it will set the cookie domain wrong. - Check
dispatcher.anyto ensureCookieheaders are passed. - Verify the
pathproperty in the SAML OSGi config. If the config is restricted to/content/secure, but the user is redirected to/aem/start.html, the SAML handler will not engage to validate the token on that path!
SAML2 Assertion is not valid anymore (Clock Skew)
Symptom: Random authentication failures. The error.log shows saml2.core.exceptions.SAMLException: SAML2 Assertion is not valid anymore.
Cause: SAML assertions contain NotBefore and NotOnOrAfter timestamps to prevent replay attacks. If the AEM server's NTP clock is slightly slower than the IdP's clock, AEM receives an assertion that technically hasn't happened yet in its local time.
Resolution: Set the clockTolerance OSGi property to 60 or 120 seconds.
Signature Mismatch Errors
Symptom: Signature validation failed in the AEM logs.
Cause: AEM is attempting to validate the XML cryptographic signature using the wrong public certificate, or the XML payload was modified in transit by a WAF or proxy.
Resolution: Ensure you downloaded the exact, currently active X.509 certificate from the IdP. If your IdP rotates certificates (often done annually), AEM will fail instantly. Update the Global TrustStore and update the idpCertAlias in the OSGi config.
Audience Restriction Failures
Symptom: AudienceRestriction validation failed in the logs.
Cause: The IdP explicitly scopes an assertion to a specific Service Provider. The Audience string in the SAML XML must identically match the serviceProviderEntityId configured in AEM.
Resolution: Check for trailing slashes or HTTP vs HTTPS mismatches. https://author.mysite.com is completely different from https://author.mysite.com/.
NameID Format Mismatches
Symptom: User logs in, assertion is valid, but AEM throws an exception regarding missing User ID, or creates a bizarrely named JCR user.
Cause: AEM expects a specific NameID format (like Email) but the IdP is sending an Opaque identifier or a Kerberos ID.
Resolution: Open the raw SAML Response XML. Look for the <saml:NameID Format="..."> node. Ensure the nameIdFormat OSGi property in AEM exactly matches the URI sent by the IdP, or simply set AEM's expected format to urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified.
Testing SSO with SAML Tracer
Never debug SAML by blindly guessing. You must read the XML. Since the SAML Response is base64 encoded within the HTTP POST, network tabs are hard to read.
Install a browser extension like SAML Tracer (available for Chrome and Firefox).
- Open SAML Tracer before initiating the login.
- Execute the login flow.
- Look for the HTTP POST request highlighted in Orange (indicating a SAML payload).
- Click the "SAML" tab in the extension. It will instantly decode and format the XML.
- Check the
<saml:Conditions>block for time validity. - Check the
<saml:AttributeStatement>block to verify that yourgroupMembershipAttribute(e.g.,groups) is actually being transmitted by the IdP. If the IdP isn't sending the groups, AEM can't sync them.
Cheat Sheet
- Token Lifecycle: Managed by the Token Authentication Handler. Relies on JCR HMAC keys.
- Global TrustStore: Stores IdP public certificates. Bound to AEM system globally.
- Service User KeyStore: Stores AEM private keys. Bound to
authentication-serviceuser. - IdP-Initiated: IdP POSTs directly to AEM. Needs
defaultRedirectUrl. - SP-Initiated: AEM redirects to IdP. Relies on
RelayStatefor routing. - AEMaaCS Author: Uses Adobe IMS. No SAML OSGi config permitted.
- AEMaaCS Publish: Uses standard Granite SAML Handler.
Best Practices
- Manage Configurations in Code: Never configure SAML via the OSGi Web Console in a production environment. Manage it via Runmode-specific OSGi config files (e.g.,
config.author.prod) in your Git repository. - Secure Credentials: Use AEM Crypto Support to encrypt your KeyStore passwords in your OSGi XML files. Committing plaintext passwords is a severe security violation.
- Automate Service Users: Use RepoInit to create the
authentication-serviceuser, build its keystore path, and grant it precise JCR permissions. Do not rely on manual clicks. - Align Session Timeouts: Ensure your AEM Token Session timeout (in Apache Jackrabbit Oak TokenConfiguration) strictly aligns with your corporate IT session policies.
- Monitor Certificate Expiry: An expired IdP certificate in the AEM TrustStore results in an immediate, unrecoverable global outage for all authors. Put it on a calendar.
Do's & Don'ts
Do's
- DO use a dedicated Entity ID for every environment (e.g.,
author-dev.mysite.com,author-prod.mysite.com). Reusing Entity IDs causes massive IdP routing conflicts. - DO enable TRACE logging on
com.adobe.granite.auth.samlthe moment you encounter an issue. - DO configure
clockTolerance. Always. - DO force HTTP Redirect for AuthnRequests (
idpHttpRedirect=true) if using Azure AD or Okta.
Don'ts
- DON'T enable XML Payload Encryption (
useEncryption=true) unless explicitly mandated by your CISO. Transport Layer Security (HTTPS) already secures the payload in transit. XML encryption adds immense debugging complexity and CPU overhead. - DON'T sync your entire Active Directory group hierarchy. Only pass claims for groups that actually govern AEM permissions (like
AEM-Authors,AEM-Approvers). - DON'T rely on just-in-time provisioning for highly restrictive workflows. Pre-create critical user groups and map them to baseline permissions via RepoInit before users ever log in.
Mastering AEM authentication requires a complete understanding of the Apache Sling pipeline, cryptographic token management, and enterprise identity protocols. Treat your identity federation as critical, fragile infrastructure, relentlessly test your caching layers, and you will secure your AEM platform against unauthorized access and catastrophic login failures.
Discussion
Loading discussion…
Try a related tool
Subscribe to the Newsletter
Get the latest articles, tutorials, and tech insights delivered straight to your inbox. No spam, unsubscribe anytime.