feat(core): Add SAML XML validation (#5600)

* consolidate SSO settings

* update saml settings

* fix type error

* limit user changes when saml is enabled

* add test

* add toggle endpoint and fetch metadata

* rename enabled param

* add handling of POST saml login request

* add config test endpoint

* adds saml XML validation

* add comment

* protect test endpoint

* improve ignoreSSL and some cleanup

* fix wrong schema used

* remove console.log
This commit is contained in:
Michael Auerswald
2023-03-06 09:44:25 +01:00
committed by GitHub
parent ddfa16cf27
commit ca66ec8f4d
16 changed files with 1672 additions and 51 deletions

View File

@@ -515,10 +515,16 @@ class Server extends AbstractServer {
// SAML
// ----------------------------------------
// initialize SamlService
await SamlService.getInstance().init();
// initialize SamlService if it is licensed, even if not enabled, to
// set up the initial environment
if (isSamlLicensed()) {
try {
await SamlService.getInstance().init();
} catch (error) {
LoggerProxy.error(`SAML initialization failed: ${error.message}`);
}
}
// public SAML endpoints
this.app.use(`/${this.restEndpoint}/sso/saml`, samlControllerPublic);
this.app.use(`/${this.restEndpoint}/sso/saml`, samlControllerProtected);