Package org.springframework.security.saml.websso

Examples of org.springframework.security.saml.websso.WebSSOProfileOptions


     * @throws Exception error
     */
    @Test
    public void testInitialProfileOptions() throws Exception {

        WebSSOProfileOptions ssoProfileOptions = entryPoint.getProfileOptions(new SAMLMessageContext(), null);
        assertEquals(new Integer(2), ssoProfileOptions.getProxyCount());
        assertTrue(ssoProfileOptions.isIncludeScoping());
        assertFalse(ssoProfileOptions.getForceAuthN());
        assertFalse(ssoProfileOptions.getPassive());
        assertNull(ssoProfileOptions.getBinding());

    }
View Full Code Here


    public void testDefaultProfileOptions() throws Exception {

        expect(request.getParameter("idp")).andReturn("http://localhost:8080/opensso").anyTimes();
        replayMock();

        WebSSOProfileOptions defaultOptions = new WebSSOProfileOptions();
        defaultOptions.setProxyCount(0);
        defaultOptions.setIncludeScoping(false);
        defaultOptions.setBinding(SAMLConstants.SAML2_REDIRECT_BINDING_URI);

        // Set default values
        entryPoint.setDefaultProfileOptions(defaultOptions);

        // Check that default values are used
        WebSSOProfileOptions ssoProfileOptions = entryPoint.getProfileOptions(new SAMLMessageContext(), null);
        assertEquals(new Integer(0), ssoProfileOptions.getProxyCount());
        assertFalse(ssoProfileOptions.isIncludeScoping());
        assertFalse(ssoProfileOptions.getForceAuthN());
        assertFalse(ssoProfileOptions.getPassive());
        assertEquals(SAMLConstants.SAML2_REDIRECT_BINDING_URI, ssoProfileOptions.getBinding());

        // Check that value can't be altered after being set
        defaultOptions.setIncludeScoping(true);
        ssoProfileOptions = entryPoint.getProfileOptions(new SAMLMessageContext(), null);
        assertFalse(ssoProfileOptions.isIncludeScoping());

        // Check that default values can be cleared
        entryPoint.setDefaultProfileOptions(null);
        ssoProfileOptions = entryPoint.getProfileOptions(new SAMLMessageContext(), null);
        assertTrue(ssoProfileOptions.isIncludeScoping());       

        verifyMock();

    }
View Full Code Here

     * @throws SAMLException             in case message sending fails
     * @throws MessageEncodingException  in case SAML message encoding fails
     */
    protected void initializeECP(SAMLMessageContext context, AuthenticationException e) throws MetadataProviderException, SAMLException, MessageEncodingException {

        WebSSOProfileOptions options = getProfileOptions(context, e);

        logger.debug("Processing SSO using ECP profile");
        webSSOprofileECP.sendAuthenticationRequest(context, options);
        samlLogger.log(SAMLConstants.AUTH_N_REQUEST, SAMLConstants.SUCCESS, context);

View Full Code Here

     * @throws MessageEncodingException  in case SAML message encoding fails
     */
    protected void initializeSSO(SAMLMessageContext context, AuthenticationException e) throws MetadataProviderException, SAMLException, MessageEncodingException {

        // Generate options for the current SSO request
        WebSSOProfileOptions options = getProfileOptions(context, e);

        // Determine the assertionConsumerService to be used
        AssertionConsumerService consumerService = SAMLUtil.getConsumerService((SPSSODescriptor) context.getLocalEntityRoleMetadata(), options.getAssertionConsumerIndex());

        // HoK WebSSO
        if (SAMLConstants.SAML2_HOK_WEBSSO_PROFILE_URI.equals(consumerService.getBinding())) {
            if (webSSOprofileHoK == null) {
                logger.warn("WebSSO HoK profile was specified to be used, but profile is not configured in the EntryPoint, HoK will be skipped");
View Full Code Here

     * @return populated webSSOprofile
     * @throws MetadataProviderException in case metadata loading fails
     */
    protected WebSSOProfileOptions getProfileOptions(SAMLMessageContext context, AuthenticationException exception) throws MetadataProviderException {

        WebSSOProfileOptions ssoProfileOptions;
        if (defaultOptions != null) {
            ssoProfileOptions = defaultOptions.clone();
        } else {
            ssoProfileOptions = new WebSSOProfileOptions();
        }

        return ssoProfileOptions;

    }
View Full Code Here

TOP

Related Classes of org.springframework.security.saml.websso.WebSSOProfileOptions

Copyright © 2018 www.massapicom. 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.