Example usage for org.springframework.security.web.context HttpSessionSecurityContextRepository HttpSessionSecurityContextRepository

List of usage examples for org.springframework.security.web.context HttpSessionSecurityContextRepository HttpSessionSecurityContextRepository

Introduction

In this page you can find the example usage for org.springframework.security.web.context HttpSessionSecurityContextRepository HttpSessionSecurityContextRepository.

Prototype

HttpSessionSecurityContextRepository

Source Link

Usage

From source file:org.vaadin.spring.security.shared.PushSecurityInterceptor.java

private synchronized SecurityContextRepository getSecurityContextRepository(ServletContext servletContext) {
    if (securityContextRepository == null) {
        final WebApplicationContext applicationContext = WebApplicationContextUtils
                .getWebApplicationContext(servletContext);
        try {/*from  www  .  j a  va2s  .  c om*/
            securityContextRepository = applicationContext.getBean(SecurityContextRepository.class);
        } catch (BeansException ex) {
            LOGGER.info(
                    "Found no SecurityContextRepository in the application context, using HttpSessionSecurityContextRepository");
            securityContextRepository = new HttpSessionSecurityContextRepository();
        }
    }
    return securityContextRepository;
}

From source file:org.devgateway.toolkit.web.spring.WebSecurityConfig.java

@Bean
public HttpSessionSecurityContextRepository httpSessionSecurityContextRepository() {
    return new HttpSessionSecurityContextRepository();
}

From source file:org.lightadmin.core.config.context.LightAdminSecurityConfiguration.java

@Bean
public Filter securityContextPersistenceFilter() {
    HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
    repo.setSpringSecurityContextKey(//w ww.  j a v a 2 s. co  m
            keyWithNamespace(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY));
    return new SecurityContextPersistenceFilter(repo);
}