Hi Members,
I am trying to implement a custom SAML implementation. I Implemented (extractCredentials & requestCredentials) methods successfully. Users can access the page, and each other behaviors are working as expected.
But in the dropCredentials methods I am facing a problem.
What I did I have a Custom Servlet for the Logout URL, from this servlet I did this,
LogOutServlet.java
String logoutUrl = "/system/sling/logout.html?resource=/content/aem-demo/fr";
response.sendRedirect(logoutUrl);
For Debug Purpose,
Authorizable user = request.getResourceResolver().adaptTo(Authorizable.class);
Here is the user I got my current login user 'user2'
By the servlet code, the expected AuthenticationHandler dropCredentials method is triggered. In this method, I tried to,
@Override
public void dropCredentials(HttpServletRequest request, HttpServletResponse response) {
if (this.handleLogout && request instanceof SlingHttpServletRequest) {
SlingHttpServletRequest slingRequest = (SlingHttpServletRequest)request;
Authorizable user = slingRequest.getResourceResolver().adaptTo(Authorizable.class);
String protectedResponse = user.getProperty("samlResponse")[0].getString();
}
}
But here the user is assigned for 'anonymous' where my login/expected user is 'user2'
What did I do wrong? Thanks in Advance for your help.