Examples of SecurityContextChannelInterceptor


Examples of org.springframework.security.messaging.context.SecurityContextChannelInterceptor

        return channelSecurityInterceptor;
    }

    @Bean
    public SecurityContextChannelInterceptor securityContextChannelInterceptor() {
        return new SecurityContextChannelInterceptor();
    }
View Full Code Here

Examples of org.springframework.security.messaging.context.SecurityContextChannelInterceptor

    @Before
    public void setup() {
        authentication = new TestingAuthenticationToken("user","pass", "ROLE_USER");
        messageBuilder = MessageBuilder.withPayload("payload");

        interceptor = new SecurityContextChannelInterceptor();
    }
View Full Code Here

Examples of org.springframework.security.messaging.context.SecurityContextChannelInterceptor

        clearContext();
    }

    @Test(expected = IllegalArgumentException.class)
    public void constructorNullHeader() {
        new SecurityContextChannelInterceptor(null);
    }
View Full Code Here

Examples of org.springframework.security.messaging.context.SecurityContextChannelInterceptor

    }

    @Test
    public void preSendCustomHeader() throws Exception {
        String headerName = "header";
        interceptor = new SecurityContextChannelInterceptor(headerName);
        messageBuilder.setHeader(headerName, authentication);

        interceptor.preSend(messageBuilder.build(), channel);

        assertThat(SecurityContextHolder.getContext().getAuthentication()).isSameAs(authentication);
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.