SEBSERV-417 fix autologin
This commit is contained in:
parent
1a5bb6ff7d
commit
a31e001f69
2 changed files with 6 additions and 4 deletions
|
@ -130,6 +130,12 @@ public final class InstitutionalAuthenticationEntryPoint implements Authenticati
|
||||||
.getBean(AuthorizationContextHolder.class);
|
.getBean(AuthorizationContextHolder.class);
|
||||||
final SEBServerAuthorizationContext authorizationContext = authorizationContextHolder
|
final SEBServerAuthorizationContext authorizationContext = authorizationContextHolder
|
||||||
.getAuthorizationContext(request.getSession());
|
.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)) {
|
if (authorizationContext.autoLogin(jwt)) {
|
||||||
forwardToEntryPoint(request, response, this.guiEntryPoint, true);
|
forwardToEntryPoint(request, response, this.guiEntryPoint, true);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -270,10 +270,6 @@ public class OAuth2AuthorizationContextHolder implements AuthorizationContextHol
|
||||||
@Override
|
@Override
|
||||||
public boolean autoLogin(final String oneTimeToken) {
|
public boolean autoLogin(final String oneTimeToken) {
|
||||||
try {
|
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
|
// Create ad-hoc RestTemplate and call token verification
|
||||||
final RestTemplate verifyTemplate = new RestTemplate(this.clientHttpRequestFactory);
|
final RestTemplate verifyTemplate = new RestTemplate(this.clientHttpRequestFactory);
|
||||||
|
|
Loading…
Reference in a new issue