Examples of SPType


Examples of org.picketlink.identity.federation.core.config.SPType

        SAML2HandlerConfig handlerConfig = new DefaultSAML2HandlerConfig();
        handlerConfig.addParameter(GeneralConstants.NAMEID_FORMAT, JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get());
        handlerConfig.addParameter(GeneralConstants.ASSERTION_SESSION_ATTRIBUTE_NAME, "org.picketlink.sp.SAML_ASSERTION");

        Map<String, Object> chainOptions = new HashMap<String, Object>();
        ProviderType spType = new SPType();
        chainOptions.put(GeneralConstants.CONFIGURATION, spType);
        chainOptions.put(GeneralConstants.ROLE_VALIDATOR_IGNORE, "true");
        chainConfig.set(chainOptions);

        // Initialize the handler
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.SPType

        String contextClasses = "password,X509, internetProtocol";
        handlerConfig.addParameter(GeneralConstants.AUTHN_CONTEXT_CLASSES, contextClasses);
        handlerConfig.addParameter(GeneralConstants.REQUESTED_AUTHN_CONTEXT_COMPARISON, AuthnContextComparisonType.MINIMUM.value());

        Map<String, Object> chainOptions = new HashMap<String, Object>();
        ProviderType spType = new SPType();
        chainOptions.put(GeneralConstants.CONFIGURATION, spType);
        chainOptions.put(GeneralConstants.ROLE_VALIDATOR_IGNORE, "true");
        chainConfig.set(chainOptions);

        // Initialize the handler
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.SPType

            }
            return roles;
        }

        private SPType getSPConfiguration() {
            SPType spConfiguration = (SPType) handlerChainConfig.getParameter(GeneralConstants.CONFIGURATION);

            if (spConfiguration == null) {
                throw logger.samlHandlerServiceProviderConfigNotFound();
            }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.SPType

*/
public class SPPostMetadataConfigurationProviderUnitTestCase {
    @Test
    public void testSPType() throws ProcessingException {
        SPPostMetadataConfigurationProvider provider = new SPPostMetadataConfigurationProvider();
        SPType sp = provider.getSPConfiguration();
        assertNotNull(sp);
        assertEquals("https://sp.testshib.org/Shibboleth.sso/SAML2/POST", sp.getServiceURL());
        assertEquals("https://idp.testshib.org/idp/profile/SAML2/POST/SLO", sp.getLogoutUrl());
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.SPType

        InputStream is = Thread.currentThread().getContextClassLoader()
                .getResourceAsStream("saml2/logout/sp/sales/WEB-INF/picketlink-idfed.xml");
        assertNotNull(is);
        provider.setConfigFile(is);

        SPType sp = provider.getSPConfiguration();
        assertNotNull(sp);
        assertEquals("https://sp.testshib.org/Shibboleth.sso/SAML2/POST", sp.getServiceURL());
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.SPType

*/
public class SPRedirectMetadataConfigurationProviderUnitTestCase {
    @Test
    public void testSPType() throws ProcessingException {
        SPRedirectMetadataConfigurationProvider provider = new SPRedirectMetadataConfigurationProvider();
        SPType sp = provider.getSPConfiguration();
        assertNotNull(sp);
        assertEquals("https://www.testshib.org/Shibboleth.sso/SAML/REDIRECT", sp.getServiceURL());
        assertEquals("https://idp.testshib.org/idp/profile/SAML2/Redirect/SLO", sp.getLogoutUrl());
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.SPType

                NameIDType nameID = new NameIDType();
                nameID.setValue(userPrincipal.getName());
                lot.setNameID(nameID);
               
                SPType spConfiguration = (SPType) getProviderconfig();
                String logoutUrl = spConfiguration.getLogoutUrl();
               
                if (logoutUrl == null) {
                    logoutUrl = spConfiguration.getIdentityURL();
                }
               
                lot.setDestination(URI.create(logoutUrl));
               
                populateSessionIndex(httpRequest, lot);
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.SPType

        public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException {
            SAML2Object samlObject = request.getSAML2Object();
            if (samlObject instanceof LogoutRequestType == false)
                return;
            //get the configuration to handle a logout request from idp and set the correct response location
            SPType spConfiguration = (SPType) getProviderconfig();
           
            LogoutRequestType logOutRequest = (LogoutRequestType) samlObject;
            HTTPContext httpContext = (HTTPContext) request.getContext();
            HttpServletRequest servletRequest = httpContext.getRequest();
            HttpSession session = servletRequest.getSession(false);

            String relayState = servletRequest.getParameter("RelayState");

            session.invalidate(); // Invalidate the current session at the SP

            // Generate a Logout Response
            StatusResponseType statusResponse = null;
            try {
                statusResponse = new StatusResponseType(IDGenerator.create("ID_"), XMLTimeUtil.getIssueInstant());
            } catch (ConfigurationException e) {
                throw logger.processingError(e);
            }

            // Status
            StatusType statusType = new StatusType();
            StatusCodeType statusCodeType = new StatusCodeType();
            statusCodeType.setValue(URI.create(JBossSAMLURIConstants.STATUS_SUCCESS.get()));
            statusType.setStatusCode(statusCodeType);

            statusResponse.setStatus(statusType);

            statusResponse.setInResponseTo(logOutRequest.getID());

            statusResponse.setIssuer(request.getIssuer());
           
            String logoutResponseLocation = spConfiguration.getLogoutResponseLocation();
            if(logoutResponseLocation == null) {
              response.setDestination(logOutRequest.getIssuer().getValue());
            } else {
              response.setDestination(logoutResponseLocation);
            }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.SPType

        List<SAML2Handler> handlers = new ArrayList<SAML2Handler>();

        handlers.add(createSignatureValidationHandler());
        handlers.add(createAuthenticationHandler());

        return getHandlerChain(new SPType(), handlers);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.