当前位置: 首页>>代码示例>>Java>>正文


Java SecurityContextRepository类代码示例

本文整理汇总了Java中org.springframework.security.web.context.SecurityContextRepository的典型用法代码示例。如果您正苦于以下问题:Java SecurityContextRepository类的具体用法?Java SecurityContextRepository怎么用?Java SecurityContextRepository使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SecurityContextRepository类属于org.springframework.security.web.context包,在下文中一共展示了SecurityContextRepository类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: securityContextRepository

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
@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;
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:18,代码来源:JwtContxtConfig.java

示例2: addFilters

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
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;
}
 
开发者ID:motech,项目名称:motech,代码行数:20,代码来源:SecurityRuleBuilder.java

示例3: inspect

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
@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;
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:14,代码来源:PushSecurityInterceptor.java

示例4: SecurityContextRepositoryResponseWrapper

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
public SecurityContextRepositoryResponseWrapper(HttpServletRequest request,
    HttpServletResponse response, SecurityContextRepository repository) {
    super(response, false);
    notNull(request);
    notNull(response);
    notNull(repository);
    this.request = request;
    this.repository = repository;
}
 
开发者ID:patka,项目名称:cognitor,代码行数:10,代码来源:SecurityContextRepositoryResponseWrapper.java

示例5: securityContextRepository

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
@Bean
public SecurityContextRepository securityContextRepository(){
    return new HttpSessionSecurityContextRepository();
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:5,代码来源:SessionConfig.java

示例6: sessionManagementFilter

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
@Bean
public SessionManagementFilter sessionManagementFilter(SecurityContextRepository securityContextRepository,
                                                       SessionAuthenticationStrategy sessionAuthenticationStrategy){
    return new SessionManagementFilter(securityContextRepository, sessionAuthenticationStrategy);
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:6,代码来源:SessionConfig.java

示例7: addSessionManagementFilter

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
private void addSessionManagementFilter(List<Filter> filters, SecurityContextRepository contextRepository) {
    SessionManagementFilter sessionManagementFilter = new SessionManagementFilter(contextRepository);
    filters.add(sessionManagementFilter);
}
 
开发者ID:motech,项目名称:motech,代码行数:5,代码来源:SecurityRuleBuilder.java

示例8: addSecurityContextPersistenceFilter

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
private void addSecurityContextPersistenceFilter(List<Filter> filters, SecurityContextRepository contextRepository) {
    SecurityContextPersistenceFilter securityContextFilter = new SecurityContextPersistenceFilter(contextRepository);
    filters.add(securityContextFilter);
}
 
开发者ID:motech,项目名称:motech,代码行数:5,代码来源:SecurityRuleBuilder.java

示例9: setSecurityContextRepository

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
public void setSecurityContextRepository(SecurityContextRepository repo) {
	this.repo = repo;
}
 
开发者ID:dana-i2cat,项目名称:opennaas-routing-nfv,代码行数:4,代码来源:SecurityContextPersistenceFilterSkipClearContext.java

示例10: getSecurityContextRepo

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
@Override
public SecurityContextRepository getSecurityContextRepo() {
    return securityContextRepo;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:5,代码来源:UserManagerImpl.java

示例11: setSecurityContextRepo

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
public void setSecurityContextRepo(
        SecurityContextRepository securityContextRepo) {
    this.securityContextRepo = securityContextRepo;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:5,代码来源:UserManagerImpl.java

示例12: getSecurityContextRepo

import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
/**
 * Returns the Security Context
 *
 * @returns {@link org.springframework.security.web.context.SecurityContextRepository}
 *          Security Context
 */
public SecurityContextRepository getSecurityContextRepo();
 
开发者ID:lbchen,项目名称:ODL,代码行数:8,代码来源:IUserManager.java


注:本文中的org.springframework.security.web.context.SecurityContextRepository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。