AuthenticationInfoPostProcessor for saml SSO
Has anyone tried to do a implementation of AuthenticationInfoPostProcessor for the saml authentication. I have configured out-of-the-box SAML Granite Authentication Handler. I need to do a post processing once the saml authentication is successful.
In my post processor implementation, I cannot get the user name from AuthInfo.
My pseudo code - (The statement on line# 21 is never reached. )
@Component(label = "Custom Authentication Post Processor", description = "Custom Authentication Post Processor for blah blah blah", immediate = true, metatype = true) @Service public class CustomAuthenticationInfoPostProcessor implements AuthenticationInfoPostProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(CustomAuthenticationInfoPostProcessor.class); @Override public void postProcess(AuthenticationInfo info, HttpServletRequest request, HttpServletResponse response) throws LoginException { if(info == null ) { LOGGER.debug("AuthenticationInfo is null. " + "Skip post processing this request."); return; } if(info.getUser() == null ) { LOGGER.debug("User is null. " + "Skip post processing this request."); return; } LOGGER.info("user is ===================> " + info.getUser()); } }Any pointers on how to retrieve user name or user id from here ?
As an alternative, how do I get the original saml request to retrieve user details from there ?
/Regards
Kanwal
