本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: securityContextRepository
import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
@Bean
public SecurityContextRepository securityContextRepository(){
return new HttpSessionSecurityContextRepository();
}
示例6: sessionManagementFilter
import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
@Bean
public SessionManagementFilter sessionManagementFilter(SecurityContextRepository securityContextRepository,
SessionAuthenticationStrategy sessionAuthenticationStrategy){
return new SessionManagementFilter(securityContextRepository, sessionAuthenticationStrategy);
}
示例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);
}
示例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);
}
示例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;
}
示例11: setSecurityContextRepo
import org.springframework.security.web.context.SecurityContextRepository; //导入依赖的package包/类
public void setSecurityContextRepo(
SecurityContextRepository securityContextRepo) {
this.securityContextRepo = securityContextRepo;
}
示例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();