public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response)
throws ProcessingException {
}
public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException {
HTTPContext httpContext = (HTTPContext) request.getContext();
ServletContext servletContext = httpContext.getServletContext();
AuthnRequestType art = (AuthnRequestType) request.getSAML2Object();
if (art == null)
throw logger.samlHandlerAuthnRequestIsNull();
String destination = art.getAssertionConsumerServiceURL().toASCIIString();
logger.trace("Destination = " + destination);
response.setDestination(destination);
HttpSession session = BaseSAML2Handler.getHttpSession(request);
Principal userPrincipal = (Principal) session.getAttribute(GeneralConstants.PRINCIPAL_ID);
if (userPrincipal == null)
userPrincipal = httpContext.getRequest().getUserPrincipal();
/*
* List<String> roles = (List<String>) session.getAttribute(GeneralConstants.ROLES_ID);
*/
try {
/*
* Map<String,Object> attribs = (Map<String, Object>) request.getOptions().get(GeneralConstants.ATTRIBUTES);
* long assertionValidity = (Long) request.getOptions().get(GeneralConstants.ASSERTIONS_VALIDITY); String
* destination = art.getAssertionConsumerServiceURL().toASCIIString(); Document samlResponse =
* this.getResponse(destination, userPrincipal, roles, request.getIssuer().getValue(), attribs,
* assertionValidity, art.getID());
*/
Document samlResponse = this.getResponse(request);
// Update the Identity Server
boolean isPost = httpContext.getRequest().getMethod().equalsIgnoreCase("POST");
IdentityServer identityServer = (IdentityServer) servletContext.getAttribute(GeneralConstants.IDENTITY_SERVER);
// We will try to find URL for global logout from SP metadata (if they are provided) and use SP logout URL
// for registration to IdentityServer
String participantLogoutURL = getParticipantURL(destination, request);