本文整理汇总了Java中org.springframework.security.web.authentication.session.SessionAuthenticationStrategy类的典型用法代码示例。如果您正苦于以下问题:Java SessionAuthenticationStrategy类的具体用法?Java SessionAuthenticationStrategy怎么用?Java SessionAuthenticationStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SessionAuthenticationStrategy类属于org.springframework.security.web.authentication.session包,在下文中一共展示了SessionAuthenticationStrategy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
@Override
public void configure(HttpSecurity builder) throws Exception {
OAuth2ClientAuthenticationProcessingFilter ssoFilter = this.filter;
ssoFilter.setSessionAuthenticationStrategy(
builder.getSharedObject(SessionAuthenticationStrategy.class));
builder.addFilterAfter(ssoFilter,
AbstractPreAuthenticatedProcessingFilter.class);
}
示例2: sessionAuthenticationStrategy
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
/**
* sessionAuthenticationStrategy does not work in JavaConfig
* @param sessionRegistry
* @return
*/
@Bean
public SessionAuthenticationStrategy sessionAuthenticationStrategy(SessionRegistry sessionRegistry){
return new ConcurrentSessionControlAuthenticationStrategy(sessionRegistry){{
setMaximumSessions(-1);
}};
}
示例3: configure
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
@Override
public void configure(H http) throws Exception {
AuthenticationTokenFilter af = getAuthenticationFilter();
if(authenticationDetailsSource != null) {
af.setAuthenticationDetailsSource(authenticationDetailsSource);
}
af.setAuthenticationManager(http.getSharedObject(AuthenticationManager.class));
af.setAuthenticationSuccessHandler(new AuthenticationStubSuccessHandler());
SessionAuthenticationStrategy sessionAuthenticationStrategy = http.getSharedObject(SessionAuthenticationStrategy.class);
if(sessionAuthenticationStrategy != null) {
af.setSessionAuthenticationStrategy(sessionAuthenticationStrategy);
}
AuthenticationTokenFilter filter = postProcess(af);
filter.setContinueChainAfterSuccessfulAuthentication(true);
http.addFilterBefore(filter, BasicAuthenticationFilter.class);
}
示例4: sessionAuthenticationStrategy
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
/**
* sessionAuthenticationStrategy does not work in JavaConfig
* @param sessionRegistry
* @return
*/
// @Bean
public SessionAuthenticationStrategy sessionAuthenticationStrategy(SessionRegistry sessionRegistry){
return new ConcurrentSessionControlAuthenticationStrategy(sessionRegistry){{
setMaximumSessions(-1);
}};
}
示例5: configure
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
@Override
public void configure(HttpSecurity http) {
authFilter.setAuthenticationDetailsSource(new WebAuthenticationDetailsSource());
authFilter.setApplicationEventPublisher(
Objects.requireNonNull(http.getSharedObject(ApplicationContext.class)));
authFilter.setAuthenticationManager(
Objects.requireNonNull(http.getSharedObject(AuthenticationManager.class)));
authFilter.setSessionAuthenticationStrategy(
Objects.requireNonNull(http.getSharedObject(SessionAuthenticationStrategy.class)));
authFilter.setRememberMeServices(
Objects.requireNonNull(http.getSharedObject(RememberMeServices.class)));
http.addFilterBefore(authFilter, UsernamePasswordAuthenticationFilter.class);
}
示例6: sessionAuthenticationStrategy
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
/**
* Defines the session authentication strategy.
*/
@Bean
@Override
protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
// When using as confidential keycloak/OpenID Connect client:
//return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());
// When using as bearer-only keycloak/OpenID Connect client:
return new NullAuthenticatedSessionStrategy();
}
示例7: configure
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
@Override
public void configure(HttpSecurity builder) throws Exception {
OAuth2ClientAuthenticationProcessingFilter ssoFilter = this.filter;
ssoFilter.setSessionAuthenticationStrategy(
builder.getSharedObject(SessionAuthenticationStrategy.class));
builder.addFilterAfter(ssoFilter,
AbstractPreAuthenticatedProcessingFilter.class);
}
示例8:
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
@Override
public void setSessionAuthenticationStrategy
(SessionAuthenticationStrategy
sessionStrategy) {
log.debug("Invoking setSessionAuthenticationStrategy");
super.setSessionAuthenticationStrategy(sessionStrategy);
}
示例9: sessionAuthenticationStrategy
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
@Bean
@Override
protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());
}
示例10: sessionManagementFilter
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
@Bean
public SessionManagementFilter sessionManagementFilter(SecurityContextRepository securityContextRepository,
SessionAuthenticationStrategy sessionAuthenticationStrategy){
return new SessionManagementFilter(securityContextRepository, sessionAuthenticationStrategy);
}
示例11: sessionAuthenticationStrategy
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
/**
* The {@link SessionAuthenticationStrategy} must be available as a Spring
* bean for Vaadin4Spring.
*/
@Bean
public SessionAuthenticationStrategy sessionAuthenticationStrategy() {
return new SessionFixationProtectionStrategy();
}
示例12: sessionAuthenticationStrategy
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
/**
* Defines the session authentication strategy.
*/
@Bean
@Override
protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());
}
示例13: sessionAuthenticationStrategy
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnProperty(name="shiny.proxy.authentication", havingValue="keycloak")
protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());
}
示例14: getSessionAuthenticationStrategy
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
public SessionAuthenticationStrategy getSessionAuthenticationStrategy() {
return sessionAuthenticationStrategy;
}
示例15: setSessionAuthenticationStrategy
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; //导入依赖的package包/类
public void setSessionAuthenticationStrategy(SessionAuthenticationStrategy sessionStrategy) {
this.sessionAuthenticationStrategy = sessionStrategy;
}