AEM SAML Authentication - SlingAuthenticator getAnonymousResolver: Anonymous access not allowed
Hi,
We are configuring AEM SAML Authentication with Azure AD according to the guide at:
This is working successfully in our Test environment, which is setup with a single Author, Publisher, and Dispatcher. In this environment we are able to log in and it is working end to end.
In the Stage environment we are having trouble getting it working. The Stage environment is set up with a single Author, two Publishers, two Dispatchers (one for each publisher), an AWS load balancer, and Cloudfront CDN.
In the Stage environment, we are getting an error with the Sling Authentication interfering and popping up a login prompt when trying to load a page that requires authentication. The expected result here is that it should redirect to the Microsoft SSO login page, allow the user to log in, and then redirect back to the saml_login page.
In the logs there is an error:
01.09.2022 16:07:00.335 *INFO* [qtp518345557-2345] org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials
This only occurs when accessing via the Dispatcher (with Cloudfront in front of the Dispatcher). Loading the page directly on the Publisher redirects to the Microsoft SSO login page as expected, but fails later at the point when redirecting to saml_login (via the Dispatcher).
We are also opening an Adobe support ticket, but thought I would open this up to the community as well to see if anyone has ideas as to what might be the cause? The configuration for the SAML Authentication Handler and Sling Authentication Service is identical between the Test and Stage environments, the only difference is that Stage has a different certificate.