SAML Handler and public page sign-in
Hi All,
I have a public site hosted on AEM. This public site has product pages, if you want to purchase, you have to log-in in order to add to cart and so on. So, basically this site has public pages and same public pages have few more options available if the end user is signed-in.
Now, the challenge here is, how can this be achieved by SAML Auth Handler as it doesn't completely supports IdP initiated auth due to the fact that it'll always come back to the home page of the site after successful authentication because request path cookie will not be set with the origination URL which can be anything.
To simplify here is the use case I want to achieve with SAML Auth Handler:
1) End user comes to a public product page within the site
2) End user clicks on sign-in
3) After successful authentication by IdP, user has redirected to the product page from where he/she initiated sign-in.
I have a work around, which I implemented in AEM 6.2, to have a servlet, serving over secured path(configured at SAML Handler and Sling Auth Service), which takes a parameter as final redirect. Now, sign-in URL will be different based on which page you're visiting on the site, i.e. going to servlet's secured path with final redirect parameter set to the current page. This way, after successful authentication, servlet will redirect to final target which was the origination page.
I don't feel this is a correct approach. I would like to utilize something with lesser custom code and more OOTB. Does anyone has come across the use case I have here and found any better way to deal with it? Is there any better approach available in AEM 6.4 or 6.5 that I might have missed?
Thanks,
Bimal