Hi @ahnc
I had previously worked on a similar requirement. The saml_request_path cookie is originally set in org.apache.sling.auth.core.spi.AuthenticationHandler. So avoid setting it in AuthenticationInfoPostProcessor.
What you can do is create a loginHook which implements AuthenticationHandler and override requestCredentials method. Set your saml_request_path inside this method.
@Override
public boolean requestCredentials(final HttpServletRequest httpServletRequest,
final HttpServletResponse httpServletResponse) throws IOException {
final int expiryTime = 60 * 60 * 60 * 24;
LOGGER.debug("Login hook initialized");
String pagePath = httpServletRequest.getRequestURI();
String queryString = httpServletRequest.getQueryString();
CookieUtil.addCookie(
ServletUtil.createCookie("saml_request_path", pagePath, true, expiryTime, null, "/", false),
httpServletResponse);
return wrappedAuthHandler.requestCredentials(httpServletRequest, httpServletResponse);
}
The above solution worked for me for this exact requirement. Hope it helps you too.
https://github.com/Adobe-Consulting-Services/acs-aem-samples/blob/master/core/src/main/java/com/adob...
Regards,
Jeevan