Java 类org.springframework.security.web.context.SecurityContextRepository 实例源码

项目:onetwo    文件:JwtContxtConfig.java   
@Bean
@Autowired
public SecurityContextRepository securityContextRepository(JwtSecurityTokenService jwtTokenService){
    JwtSecurityContextRepository jwt = new JwtSecurityContextRepository();
    jwt.setJwtTokenService(jwtTokenService);
    String authName = securityConfig.getJwt().getAuthKey();
    if(StringUtils.isBlank(authName)){
        authName = securityConfig.getJwt().getAuthHeader();
    }
    jwt.setAuthHeaderName(authName);
    jwt.setAuthStore(securityConfig.getJwt().getAuthStore());
    jwt.setCookieStorer(CookieStorer.builder()
                                    .cookieDomain(securityConfig.getCookie().getDomain())
                                    .cookiePath(securityConfig.getCookie().getPath())
                                    .build());
    return jwt;
}
项目:motech    文件:SecurityRuleBuilder.java   
private List<Filter> addFilters(MotechURLSecurityRule securityRule) throws ServletException {
    List<Filter> filters = new ArrayList<>();

    SecurityContextRepository contextRepository = new HttpSessionSecurityContextRepository();
    RequestCache requestCache = new HttpSessionRequestCache();

    addSecureChannel(filters, securityRule.getProtocol());
    addSecurityContextPersistenceFilter(filters, contextRepository);
    addLogoutFilter(filters, securityRule);
    addAuthenticationFilters(filters, securityRule);
    addRequestCacheFilter(filters, requestCache);
    addSecurityContextHolderAwareRequestFilter(filters);
    addAnonymousAuthenticationFilter(filters);
    addSessionManagementFilter(filters, contextRepository);
    addExceptionTranslationFilter(filters, requestCache, securityRule.isRest());
    addFilterSecurityInterceptor(filters, securityRule);

    return filters;
}
项目:vaadin4spring    文件:PushSecurityInterceptor.java   
@Override
public Action inspect(AtmosphereResource r) {
    final SecurityContextRepository securityContextRepo = getSecurityContextRepository(
        r.getAtmosphereConfig().getServletContext());
    if (securityContextRepo.containsContext(r.getRequest())) {
        LOGGER.trace("Loading the security context from the session");
        final HttpRequestResponseHolder requestResponse = new HttpRequestResponseHolder(r.getRequest(),
            r.getResponse());
        final SecurityContext securityContext = securityContextRepo.loadContext(requestResponse);
        SecurityContextHolder.setContext(securityContext);
    }
    return Action.CONTINUE;
}
项目:cognitor    文件:SecurityContextRepositoryResponseWrapper.java   
public SecurityContextRepositoryResponseWrapper(HttpServletRequest request,
    HttpServletResponse response, SecurityContextRepository repository) {
    super(response, false);
    notNull(request);
    notNull(response);
    notNull(repository);
    this.request = request;
    this.repository = repository;
}
项目:Spring-Security-Third-Edition    文件:SessionConfig.java   
@Bean
public SecurityContextRepository securityContextRepository(){
    return new HttpSessionSecurityContextRepository();
}
项目:Spring-Security-Third-Edition    文件:SessionConfig.java   
@Bean
public SessionManagementFilter sessionManagementFilter(SecurityContextRepository securityContextRepository,
                                                       SessionAuthenticationStrategy sessionAuthenticationStrategy){
    return new SessionManagementFilter(securityContextRepository, sessionAuthenticationStrategy);
}
项目:motech    文件:SecurityRuleBuilder.java   
private void addSessionManagementFilter(List<Filter> filters, SecurityContextRepository contextRepository) {
    SessionManagementFilter sessionManagementFilter = new SessionManagementFilter(contextRepository);
    filters.add(sessionManagementFilter);
}
项目:motech    文件:SecurityRuleBuilder.java   
private void addSecurityContextPersistenceFilter(List<Filter> filters, SecurityContextRepository contextRepository) {
    SecurityContextPersistenceFilter securityContextFilter = new SecurityContextPersistenceFilter(contextRepository);
    filters.add(securityContextFilter);
}
项目:opennaas-routing-nfv    文件:SecurityContextPersistenceFilterSkipClearContext.java   
public void setSecurityContextRepository(SecurityContextRepository repo) {
    this.repo = repo;
}
项目:ODL    文件:UserManagerImpl.java   
@Override
public SecurityContextRepository getSecurityContextRepo() {
    return securityContextRepo;
}
项目:ODL    文件:UserManagerImpl.java   
public void setSecurityContextRepo(
        SecurityContextRepository securityContextRepo) {
    this.securityContextRepo = securityContextRepo;
}
项目:ODL    文件:IUserManager.java   
/**
 * Returns the Security Context
 *
 * @returns {@link org.springframework.security.web.context.SecurityContextRepository}
 *          Security Context
 */
public SecurityContextRepository getSecurityContextRepo();