Package org.springframework.security.remoting.httpinvoker

Examples of org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor


        Authentication clientSideAuthentication = new UsernamePasswordAuthenticationToken("Aladdin", "open sesame");
        SecurityContextHolder.getContext().setAuthentication(clientSideAuthentication);

        // Create a connection and ensure our executor sets its
        // properties correctly
        AuthenticationSimpleHttpInvokerRequestExecutor executor = new AuthenticationSimpleHttpInvokerRequestExecutor();
        HttpURLConnection conn = new MockHttpURLConnection(new URL("http://localhost/"));
        executor.prepareConnection(conn, 10);

        // Check connection properties
        // See http://www.faqs.org/rfcs/rfc1945.html section 11.1 for example
        // we are comparing against
        assertEquals("Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", conn.getRequestProperty("Authorization"));
View Full Code Here


    public void testNullContextHolderIsNull() throws Exception {
        SecurityContextHolder.getContext().setAuthentication(null);

        // Create a connection and ensure our executor sets its
        // properties correctly
        AuthenticationSimpleHttpInvokerRequestExecutor executor = new AuthenticationSimpleHttpInvokerRequestExecutor();
        HttpURLConnection conn = new MockHttpURLConnection(new URL("http://localhost/"));
        executor.prepareConnection(conn, 10);

        // Check connection properties (shouldn't be an Authorization header)
        assertNull(conn.getRequestProperty("Authorization"));
    }
View Full Code Here

                AuthorityUtils.createAuthorityList("ROLE_ANONYMOUS"));
        SecurityContextHolder.getContext().setAuthentication(anonymous);

        // Create a connection and ensure our executor sets its
        // properties correctly
        AuthenticationSimpleHttpInvokerRequestExecutor executor = new AuthenticationSimpleHttpInvokerRequestExecutor();
        HttpURLConnection conn = new MockHttpURLConnection(new URL("http://localhost/"));
        executor.prepareConnection(conn, 10);

        // Check connection properties (shouldn't be an Authorization header)
        assertNull(conn.getRequestProperty("Authorization"));
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor

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.