本文整理汇总了Java中org.springframework.security.core.context.SecurityContextHolder.setStrategyName方法的典型用法代码示例。如果您正苦于以下问题:Java SecurityContextHolder.setStrategyName方法的具体用法?Java SecurityContextHolder.setStrategyName怎么用?Java SecurityContextHolder.setStrategyName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.security.core.context.SecurityContextHolder
的用法示例。
在下文中一共展示了SecurityContextHolder.setStrategyName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import org.springframework.security.core.context.SecurityContextHolder; //导入方法依赖的package包/类
@Override
protected void configure(HttpSecurity http) throws Exception {
final String ADMIN = ApplicationProperties.get("jwala.role.admin");
final String AUTH = ApplicationProperties.get(JWALA_AUTH_ENABLED, "true");
http.authorizeRequests().antMatchers(GEN_PUBLIC_RESOURCES, PUBLIC_RESOURCES, LOGIN_PAGE, LOGIN_API, LOGOUT_API)
.permitAll().and().formLogin().loginPage(LOGIN_PAGE).permitAll().and().authorizeRequests().anyRequest()
.authenticated();
http.csrf().disable();
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_THREADLOCAL);
}
示例2: configure
import org.springframework.security.core.context.SecurityContextHolder; //导入方法依赖的package包/类
@Override
protected void configure(HttpSecurity http) throws Exception {
http.httpBasic().disable();
http.authorizeRequests().antMatchers("/", "/public/**", "/internal/**").permitAll()//
.anyRequest().authenticated()//
;
// .and().csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse());
// se habilita el contexto se seguridad para llamados asincronos
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
}
示例3: SecurityConfig
import org.springframework.security.core.context.SecurityContextHolder; //导入方法依赖的package包/类
public SecurityConfig() {
super();
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
}
示例4: SecurityConfig
import org.springframework.security.core.context.SecurityContextHolder; //导入方法依赖的package包/类
public SecurityConfig() {
super();
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
}