public static SAML2HandlerChain createChain() { return new DefaultSAML2HandlerChain(); }
protected SAML2HandlerRequest getSAML2HandlerRequest(SAMLDocumentHolder documentHolder, HTTPContext httpContext) { IssuerInfoHolder holder = null; if (issuer == null) { holder = new IssuerInfoHolder(this.serviceURL); } else { holder = new IssuerInfoHolder(issuer); } return new DefaultSAML2HandlerRequest(httpContext, holder.getIssuer(), documentHolder, HANDLER_TYPE.SP); }
protected void initializeHandlerChain() throws ConfigurationException, ProcessingException { populateChainConfig(); SAML2HandlerChainConfig handlerChainConfig = new DefaultSAML2HandlerChainConfig(chainConfigOptions); Set<SAML2Handler> samlHandlers = chain.handlers(); for (SAML2Handler handler : samlHandlers) { handler.initChainConfig(handlerChainConfig); } }
private SAML2HandlerResponse processHandlersChain(HTTPContext httpContext, Set<SAML2Handler> handlers, Lock chainLock, SAMLDocumentHolder documentHolder) throws ConfigurationException, ProcessingException, TrustKeyConfigurationException, TrustKeyProcessingException, IOException { // Create the request/response SAML2HandlerRequest saml2HandlerRequest = getSAML2HandlerRequest(documentHolder, httpContext); SAML2HandlerResponse saml2HandlerResponse = new DefaultSAML2HandlerResponse(); SAMLHandlerChainProcessor chainProcessor = new SAMLHandlerChainProcessor(handlers); // Set some request options setRequestOptions(saml2HandlerRequest); saml2HandlerRequest.addOption(GeneralConstants.CONTEXT_PATH, httpContext.getServletContext().getContextPath()); saml2HandlerRequest.addOption(GeneralConstants.SUPPORTS_SIGNATURES, this.spConfiguration.isSupportsSignature()); chainProcessor.callHandlerChain(documentHolder.getSamlObject(), saml2HandlerRequest, saml2HandlerResponse, httpContext, chainLock); return saml2HandlerResponse; }
public static Set<SAML2Handler> getHandlers(Handlers handlers) throws ConfigurationException { if (handlers == null) throw logger.nullArgumentError("handlers"); List<Handler> handlerList = handlers.getHandler(); Set<SAML2Handler> handlerSet = new LinkedHashSet<SAML2Handler>(); for (Handler handler : handlerList) { SAML2Handler samlhandler = createInstance(handler); List<KeyValueType> options = handler.getOption(); Map<String, Object> mapOptions = new HashMap<String, Object>(); for (KeyValueType kvtype : options) { mapOptions.put(kvtype.getKey(), kvtype.getValue()); } SAML2HandlerConfig handlerConfig = new DefaultSAML2HandlerConfig(); handlerConfig.set(mapOptions); samlhandler.initHandlerConfig(handlerConfig); handlerSet.add(samlhandler); } return handlerSet; }
protected void initializeHandlerChain() throws ConfigurationException, ProcessingException { populateChainConfig(); SAML2HandlerChainConfig handlerChainConfig = new DefaultSAML2HandlerChainConfig(chainConfigOptions); Set<SAML2Handler> samlHandlers = chain.handlers(); for (SAML2Handler handler : samlHandlers) { handler.initChainConfig(handlerChainConfig); } }
protected SAML2HandlerRequest getSAML2HandlerRequest(SAMLDocumentHolder documentHolder, HTTPContext httpContext) { IssuerInfoHolder holder = null; if (issuer == null) { holder = new IssuerInfoHolder(this.serviceURL); } else { holder = new IssuerInfoHolder(issuer); } return new DefaultSAML2HandlerRequest(httpContext, holder.getIssuer(), documentHolder, HANDLER_TYPE.SP); }
private SAML2HandlerResponse processHandlersChain(HTTPContext httpContext, Set<SAML2Handler> handlers, Lock chainLock, SAMLDocumentHolder documentHolder) throws ConfigurationException, ProcessingException, IOException { // Create the request/response SAML2HandlerRequest saml2HandlerRequest = getSAML2HandlerRequest(documentHolder, httpContext); SAML2HandlerResponse saml2HandlerResponse = new DefaultSAML2HandlerResponse(); SAMLHandlerChainProcessor chainProcessor = new SAMLHandlerChainProcessor(handlers, this.configuration); // Set some request options setRequestOptions(saml2HandlerRequest); saml2HandlerRequest.addOption(GeneralConstants.CONTEXT_PATH, httpContext.getServletContext().getContextPath()); saml2HandlerRequest.addOption(GeneralConstants.SUPPORTS_SIGNATURES, getSpConfiguration().isSupportsSignature()); chainProcessor.callHandlerChain(documentHolder.getSamlObject(), saml2HandlerRequest, saml2HandlerResponse, httpContext, chainLock); return saml2HandlerResponse; }
public static SAML2HandlerChain createChain() { return new DefaultSAML2HandlerChain(); }
public static Set<SAML2Handler> getHandlers(Handlers handlers) throws ConfigurationException { if (handlers == null) throw logger.nullArgumentError("handlers"); List<Handler> handlerList = handlers.getHandler(); Set<SAML2Handler> handlerSet = new LinkedHashSet<SAML2Handler>(); for (Handler handler : handlerList) { SAML2Handler samlhandler = createInstance(handler); List<KeyValueType> options = handler.getOption(); Map<String, Object> mapOptions = new HashMap<String, Object>(); for (KeyValueType kvtype : options) { mapOptions.put(kvtype.getKey(), kvtype.getValue()); } SAML2HandlerConfig handlerConfig = new DefaultSAML2HandlerConfig(); handlerConfig.set(mapOptions); samlhandler.initHandlerConfig(handlerConfig); handlerSet.add(samlhandler); } return handlerSet; }
protected void initializeHandlerChain(PicketLinkType picketLinkType) throws Exception { SAML2HandlerChain handlerChain; // Get the chain from config if (isNullOrEmpty(samlHandlerChainClass)) { handlerChain = SAML2HandlerChainFactory.createChain(); } else { try { handlerChain = SAML2HandlerChainFactory.createChain(this.samlHandlerChainClass); } catch (ProcessingException e1) { throw new RuntimeException(e1); } } Handlers handlers = picketLinkType.getHandlers(); if (handlers == null) { // Get the handlers String handlerConfigFileName = GeneralConstants.HANDLER_CONFIG_FILE_LOCATION; handlers = ConfigurationUtil.getHandlers(servletContext.getResourceAsStream(handlerConfigFileName)); } picketLinkType.setHandlers(handlers); handlerChain.addAll(HandlerUtil.getHandlers(handlers)); populateChainConfig(picketLinkType); SAML2HandlerChainConfig handlerChainConfig = new DefaultSAML2HandlerChainConfig(chainConfigOptions); Set<SAML2Handler> samlHandlers = handlerChain.handlers(); for (SAML2Handler handler : samlHandlers) { handler.initChainConfig(handlerChainConfig); } chain = handlerChain; }
protected SAML2HandlerRequest getSAML2HandlerRequest(SAMLDocumentHolder documentHolder, HTTPContext httpContext) { IssuerInfoHolder holder = null; if (issuer == null) { holder = new IssuerInfoHolder(this.serviceURL); } else { holder = new IssuerInfoHolder(issuer); } return new DefaultSAML2HandlerRequest(httpContext, holder.getIssuer(), documentHolder, HANDLER_TYPE.SP); }
private SAML2HandlerResponse processHandlersChain(HTTPContext httpContext, Set<SAML2Handler> handlers, Lock chainLock, SAMLDocumentHolder documentHolder) throws ConfigurationException, ProcessingException, IOException { // Create the request/response SAML2HandlerRequest saml2HandlerRequest = getSAML2HandlerRequest(documentHolder, httpContext); SAML2HandlerResponse saml2HandlerResponse = new DefaultSAML2HandlerResponse(); SAMLHandlerChainProcessor chainProcessor = new SAMLHandlerChainProcessor(handlers, this.configuration); // Set some request options setRequestOptions(saml2HandlerRequest); saml2HandlerRequest.addOption(GeneralConstants.CONTEXT_PATH, httpContext.getServletContext().getContextPath()); saml2HandlerRequest.addOption(GeneralConstants.SUPPORTS_SIGNATURES, getSpConfiguration().isSupportsSignature()); chainProcessor.callHandlerChain(documentHolder.getSamlObject(), saml2HandlerRequest, saml2HandlerResponse, httpContext, chainLock); return saml2HandlerResponse; }
public static SAML2HandlerChain createChain() { return new DefaultSAML2HandlerChain(); }
protected void initializeHandlerChain(PicketLinkType picketLinkType) throws Exception { SAML2HandlerChain handlerChain; // Get the chain from config if (isNullOrEmpty(samlHandlerChainClass)) { handlerChain = SAML2HandlerChainFactory.createChain(); } else { try { handlerChain = SAML2HandlerChainFactory.createChain(this.samlHandlerChainClass); } catch (ProcessingException e1) { throw new RuntimeException(e1); } } Handlers handlers = picketLinkType.getHandlers(); if (handlers == null) { // Get the handlers String handlerConfigFileName = GeneralConstants.HANDLER_CONFIG_FILE_LOCATION; handlers = ConfigurationUtil.getHandlers(servletContext.getResourceAsStream(handlerConfigFileName)); } picketLinkType.setHandlers(handlers); handlerChain.addAll(HandlerUtil.getHandlers(handlers)); populateChainConfig(picketLinkType); SAML2HandlerChainConfig handlerChainConfig = new DefaultSAML2HandlerChainConfig(chainConfigOptions); Set<SAML2Handler> samlHandlers = handlerChain.handlers(); for (SAML2Handler handler : samlHandlers) { handler.initChainConfig(handlerChainConfig); } chain = handlerChain; }
protected SAML2HandlerRequest getSAML2HandlerRequest(SAMLDocumentHolder documentHolder, HTTPContext httpContext) { IssuerInfoHolder holder = null; if (issuer == null) { holder = new IssuerInfoHolder(this.serviceURL); } else { holder = new IssuerInfoHolder(issuer); } return new DefaultSAML2HandlerRequest(httpContext, holder.getIssuer(), documentHolder, HANDLER_TYPE.SP); }
public static SAML2HandlerChain createChain() { return new DefaultSAML2HandlerChain(); }
protected void initializeHandlerChain(PicketLinkType picketLinkType) throws Exception { SAML2HandlerChain handlerChain; // Get the chain from config if (isNullOrEmpty(samlHandlerChainClass)) { handlerChain = SAML2HandlerChainFactory.createChain(); } else { try { handlerChain = SAML2HandlerChainFactory.createChain(this.samlHandlerChainClass); } catch (ProcessingException e1) { throw new LifecycleException(e1); } } Handlers handlers = picketLinkType.getHandlers(); if (handlers == null) { // Get the handlers String handlerConfigFileName = GeneralConstants.HANDLER_CONFIG_FILE_LOCATION; ServletContext servletContext = context.getServletContext(); handlers = ConfigurationUtil.getHandlers(servletContext.getResourceAsStream(handlerConfigFileName)); } picketLinkType.setHandlers(handlers); handlerChain.addAll(HandlerUtil.getHandlers(handlers)); populateChainConfig(picketLinkType); SAML2HandlerChainConfig handlerChainConfig = new DefaultSAML2HandlerChainConfig(chainConfigOptions); Set<SAML2Handler> samlHandlers = handlerChain.handlers(); for (SAML2Handler handler : samlHandlers) { handler.initChainConfig(handlerChainConfig); } chain = handlerChain; }
protected SAML2HandlerRequest getSAML2HandlerRequest(SAMLDocumentHolder documentHolder, HTTPContext httpContext) { IssuerInfoHolder holder = null; if (issuer == null) { holder = new IssuerInfoHolder(this.serviceURL); } else { holder = new IssuerInfoHolder(issuer); } return new DefaultSAML2HandlerRequest(httpContext, holder.getIssuer(), documentHolder, HANDLER_TYPE.SP); }
public static SAML2HandlerChain createChain() { return new DefaultSAML2HandlerChain(); }