cn.antcore.security.config.SecurityConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boot-starter-security Show documentation
Show all versions of spring-boot-starter-security Show documentation
This is spring-boot-starter-security.
The newest version!
package cn.antcore.security.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
/**
* Security 配置文件
*
* Created by Hong.
* 2021/3/25
**/
@Component
@ConfigurationProperties(prefix = "spring.security")
public class SecurityConfig {
/** Session失效时间 **/
private Duration sessionTime = Duration.of(24, ChronoUnit.HOURS);
/** Session再每次请求后自动续签 **/
private boolean automaticRenewal = true;
/** 用户最大同时存活数 **/
private int maxLive = 1;
public Duration getSessionTime() {
return sessionTime;
}
public void setSessionTime(Duration sessionTime) {
this.sessionTime = sessionTime;
}
public boolean isAutomaticRenewal() {
return automaticRenewal;
}
public void setAutomaticRenewal(boolean automaticRenewal) {
this.automaticRenewal = automaticRenewal;
}
public int getMaxLive() {
return maxLive;
}
public void setMaxLive(int maxLive) {
this.maxLive = maxLive;
}
}