fixed GUI session timout, set default to 18000

This commit is contained in:
anhefti 2022-02-08 11:18:01 +01:00
parent d6c000b513
commit a01ed72d57
4 changed files with 11 additions and 11 deletions

View file

@ -173,11 +173,11 @@ public class RAPConfiguration implements ApplicationConfiguration {
final Integer sessionTimeout = environment.getProperty( final Integer sessionTimeout = environment.getProperty(
ATTR_USER_SESSION_TIMEOUT, ATTR_USER_SESSION_TIMEOUT,
Integer.class, Integer.class,
-1); 18000);
httpSession.setMaxInactiveInterval(sessionTimeout); httpSession.setMaxInactiveInterval(sessionTimeout);
} else { } else {
httpSession.setMaxInactiveInterval(-1); httpSession.setMaxInactiveInterval(18000);
} }
final EntryPointService entryPointService = webApplicationContext final EntryPointService entryPointService = webApplicationContext

View file

@ -137,13 +137,11 @@ public class ExamDAOImpl implements ExamDAO {
} }
@Override @Override
@Transactional(readOnly = true)
public Result<Collection<Long>> allInstitutionIdsByQuizId(final String quizId) { public Result<Collection<Long>> allInstitutionIdsByQuizId(final String quizId) {
return this.examRecordDAO.allInstitutionIdsByQuizId(quizId); return this.examRecordDAO.allInstitutionIdsByQuizId(quizId);
} }
@Override @Override
@Transactional(readOnly = true)
public Result<Collection<Exam>> allMatching(final FilterMap filterMap, final Predicate<Exam> predicate) { public Result<Collection<Exam>> allMatching(final FilterMap filterMap, final Predicate<Exam> predicate) {
return Result.tryCatch(() -> { return Result.tryCatch(() -> {
@ -181,7 +179,6 @@ public class ExamDAOImpl implements ExamDAO {
} }
@Override @Override
@Transactional
public Result<Exam> updateState(final Long examId, final ExamStatus status, final String updateId) { public Result<Exam> updateState(final Long examId, final ExamStatus status, final String updateId) {
return this.examRecordDAO return this.examRecordDAO
.updateState(examId, status, updateId) .updateState(examId, status, updateId)
@ -196,7 +193,6 @@ public class ExamDAOImpl implements ExamDAO {
} }
@Override @Override
@Transactional
public Result<Exam> setSEBRestriction(final Long examId, final boolean sebRestriction) { public Result<Exam> setSEBRestriction(final Long examId, final boolean sebRestriction) {
return this.examRecordDAO return this.examRecordDAO
.setSEBRestriction(examId, sebRestriction) .setSEBRestriction(examId, sebRestriction)
@ -204,7 +200,6 @@ public class ExamDAOImpl implements ExamDAO {
} }
@Override @Override
@Transactional
public Result<Exam> createNew(final Exam exam) { public Result<Exam> createNew(final Exam exam) {
return this.examRecordDAO return this.examRecordDAO
.createNew(exam) .createNew(exam)
@ -298,7 +293,6 @@ public class ExamDAOImpl implements ExamDAO {
} }
@Override @Override
@Transactional(readOnly = true)
public Result<Collection<Exam>> allForEndCheck() { public Result<Collection<Exam>> allForEndCheck() {
return this.examRecordDAO return this.examRecordDAO
.allForEndCheck() .allForEndCheck()
@ -409,7 +403,6 @@ public class ExamDAOImpl implements ExamDAO {
} }
@Override @Override
@Transactional(readOnly = true)
public Result<Boolean> isLocked(final Long examId) { public Result<Boolean> isLocked(final Long examId) {
return this.examRecordDAO return this.examRecordDAO
.recordById(examId) .recordById(examId)
@ -543,7 +536,6 @@ public class ExamDAOImpl implements ExamDAO {
} }
@Override @Override
@Transactional(readOnly = true)
public Result<Collection<Exam>> allOf(final Set<Long> pks) { public Result<Collection<Exam>> allOf(final Set<Long> pks) {
return this.examRecordDAO return this.examRecordDAO
.allOf(pks) .allOf(pks)

View file

@ -10,6 +10,7 @@ package ch.ethz.seb.sebserver.webservice.weblayer.oauth;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
@ -55,6 +56,10 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap
@Autowired @Autowired
@Qualifier(WebServiceSecurityConfig.AUTHENTICATION_MANAGER) @Qualifier(WebServiceSecurityConfig.AUTHENTICATION_MANAGER)
private AuthenticationManager authenticationManager; private AuthenticationManager authenticationManager;
@Value("${sebserver.webservice.api.admin.accessTokenValiditySeconds:3600}")
private Integer adminAccessTokenValSec;
@Value("${sebserver.webservice.api.admin.refreshTokenValiditySeconds:-1}")
private Integer adminRefreshTokenValSec;
@Override @Override
public void configure(final AuthorizationServerSecurityConfigurer oauthServer) { public void configure(final AuthorizationServerSecurityConfigurer oauthServer) {
@ -78,7 +83,10 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap
defaultTokenServices.setTokenStore(this.tokenStore); defaultTokenServices.setTokenStore(this.tokenStore);
defaultTokenServices.setAuthenticationManager(this.authenticationManager); defaultTokenServices.setAuthenticationManager(this.authenticationManager);
defaultTokenServices.setSupportRefreshToken(true); defaultTokenServices.setSupportRefreshToken(true);
defaultTokenServices.setReuseRefreshToken(true);
defaultTokenServices.setTokenEnhancer(jwtAccessTokenConverter); defaultTokenServices.setTokenEnhancer(jwtAccessTokenConverter);
defaultTokenServices.setAccessTokenValiditySeconds(this.adminAccessTokenValSec);
defaultTokenServices.setRefreshTokenValiditySeconds(this.adminRefreshTokenValSec);
endpoints endpoints
.tokenStore(this.tokenStore) .tokenStore(this.tokenStore)

View file

@ -1,7 +1,7 @@
########################################################## ##########################################################
### SEB Server GUI configuration ### SEB Server GUI configuration
sebserver.gui.session.timeout=-1 sebserver.gui.session.timeout=18000
# theme # theme
sebserver.gui.theme=css/sebserver.css sebserver.gui.theme=css/sebserver.css