SEBSERV-417 fix autologin

This commit is contained in:
anhefti 2024-06-19 16:38:30 +02:00
parent 1a5bb6ff7d
commit a31e001f69
2 changed files with 6 additions and 4 deletions

View file

@ -130,6 +130,12 @@ public final class InstitutionalAuthenticationEntryPoint implements Authenticati
.getBean(AuthorizationContextHolder.class);
final SEBServerAuthorizationContext authorizationContext = authorizationContextHolder
.getAuthorizationContext(request.getSession());
// check first if we already have an active session if so, invalidate ir
if (authorizationContext.isLoggedIn()) {
authorizationContext.logout();
}
if (authorizationContext.autoLogin(jwt)) {
forwardToEntryPoint(request, response, this.guiEntryPoint, true);
return;

View file

@ -270,10 +270,6 @@ public class OAuth2AuthorizationContextHolder implements AuthorizationContextHol
@Override
public boolean autoLogin(final String oneTimeToken) {
try {
// check first if we already have an active session if so, invalidate ir
if (this.isLoggedIn()) {
this.logout();
}
// Create ad-hoc RestTemplate and call token verification
final RestTemplate verifyTemplate = new RestTemplate(this.clientHttpRequestFactory);