SEBSERV-572 fixed, added new property setting sebserver.webservice.autologin.url

This commit is contained in:
anhefti 2024-08-13 08:34:25 +02:00
parent f88335b17c
commit d5ccc0f093
4 changed files with 15 additions and 3 deletions

View file

@ -51,6 +51,7 @@ public class WebserviceInfo {
private static final String WEB_SERVICE_EXTERNAL_ADDRESS_ALIAS = "sebserver.webservice.lms.address.alias";
private static final String WEB_SERVICE_CONTEXT_PATH = "server.servlet.context-path";
public static final String SEBSERVER_WEBSERVICE_AUTOLOGIN_ENDPOINT = "sebserver.webservice.autologin.endpoint";
public static final String WEB_SERVICE_GUI_AUTOLOGIN_URL_KEY = "sebserver.webservice.autologin.url";
private final String sebServerVersion;
private final String testProperty;
@ -69,6 +70,8 @@ public class WebserviceInfo {
private final boolean isDistributed;
private final String webserviceUUID;
private final String guiAutologinURL;
private final long distributedUpdateInterval;
private Map<String, String> lmsExternalAddressAlias;
@ -135,6 +138,11 @@ public class WebserviceInfo {
builder.path(this.contextPath);
}
this.serverURLPrefix = builder.toUriString();
String guiAutologinURL = environment.getProperty(WEB_SERVICE_GUI_AUTOLOGIN_URL_KEY, builder.toUriString());
if (StringUtils.isBlank(guiAutologinURL)) {
guiAutologinURL = builder.toUriString();
}
this.guiAutologinURL = guiAutologinURL;
this.isLightSetup = BooleanUtils.toBoolean(environment.getProperty(
"sebserver.webservice.light.setup",
@ -295,6 +303,10 @@ public class WebserviceInfo {
return this.serverURLPrefix;
}
public String getGUIAutologinURL() {
return this.guiAutologinURL;
}
public String getOAuthTokenURI() {
return getExternalServerURL() + API.OAUTH_TOKEN_ENDPOINT;
}
@ -359,8 +371,6 @@ public class WebserviceInfo {
return builder.toString();
}
public static final class ScreenProctoringServiceBundle implements SPSAPIAccessData {
public final boolean bundled;

View file

@ -158,6 +158,7 @@ public class WebserviceInit implements ApplicationListener<ApplicationReadyEvent
SEBServerInit.INIT_LOGGER.info("---->");
SEBServerInit.INIT_LOGGER.info("----> Context Path: {}", this.webserviceInfo.getContextPath());
SEBServerInit.INIT_LOGGER.info("----> External-Host URL: {}", this.webserviceInfo.getExternalServerURL());
SEBServerInit.INIT_LOGGER.info("----> Autologin URL: {}", this.webserviceInfo.getGUIAutologinURL());
SEBServerInit.INIT_LOGGER.info("----> LMS-External-Address-Alias: {}",
this.webserviceInfo.getLmsExternalAddressAlias());
SEBServerInit.INIT_LOGGER.info("---->");

View file

@ -207,6 +207,6 @@ public class LmsIntegrationController {
return new FullLmsIntegrationService.TokenLoginResponse(
lmsUUId,
webserviceInfo.getExternalServerURL() + API.LMS_FULL_INTEGRATION_LOGIN_TOKEN_ENDPOINT + "?jwt=" + token);
webserviceInfo.getGUIAutologinURL() + API.LMS_FULL_INTEGRATION_LOGIN_TOKEN_ENDPOINT + "?jwt=" + token);
}
}

View file

@ -48,6 +48,7 @@ sebserver.webservice.http.external.port=
sebserver.webservice.http.redirect.gui=/gui
sebserver.webservice.ping.service.strategy=BLOCKING
sebserver.webservice.autologin.endpoint=/auto_login
sebserver.webservice.autologin.url=
### webservice API