Issues in Permission Sensitive Caching : Auth checker path in Sling Authenticator
Hi Team,
We have configured OKTA SAML for our project content directory /content/xyz and enabled auth_checker for all the secured pages in AEM (AEM as a Cloud Service) by following the below documentation :
https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/permissions-cache.html?lang=en
https://www.danklco.com/posts/2021/04/saml-authentication-aem-permissions-sensitive-caching.html
We enabled dispatcher caching and disabled CDN caching for secured content.
So, In new session when we hit the page URL directly in browser for first time (no cache) it's redirecting to OKTA page correctly but when the file is already in cache and if we hit that page URL in browser it's trying to invoke auth_checker service (/bin/auth/permissioncheck.html) with the SAML enabled url path.
Since user is anonymous user it's redirecting to forbidden page (403 ) instead of OKTA redirect.
When I exclude auth_checker path (/bin/auth/permissioncheck.html)) in Sling Authenticator , this 403 redirection is happening.
org.apache.sling.engine.impl.auth.SlingAuthenticator.cfg.json
If I include auth checker path in in Sling Authenticator and page is cached , then page request is going to 404 with below error
/libs/granite/core/content/login.html?resource=%2Fbin%%2Fauthcheck%3Furi%3D%2Fcontent%2Fxyz%2Fen-us%2Fcollections%2Fall-products%2abc.html&$$login$$=%24%24login%24%24&j_reason=unknown&j_reason_code=unknown
In summary, When content is cached in Dispatcher , the page request has issues in below 2 scenarios.
1. If I include auth checker path in Sling Authenticator, --------->404
2. If I exclude auth checker path in Sling Authenticator, --------->403
What should we in this scenario.
Expectation:
if Page is cached and active session is not there , then the new request to AEM page should redirect to OKTA page instead of 403 or 404.
Any idea /suggestions on this issue.
CC: @kautuk_sahni @joerghoh @arunpatidar @aanchalsikka