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

@@ -1,4 +1,5 @@
import config from '@/config';
import type { AuthProviderType } from '@/databases/entities/AuthIdentity';
export function isSamlCurrentAuthenticationMethod(): boolean {
return config.getEnv('userManagement.authenticationMethod') === 'saml';
@@ -12,8 +13,6 @@ export function doRedirectUsersFromLoginToSsoFlow(): boolean {
return config.getEnv('sso.redirectLoginToSso');
}
export function setCurrentAuthenticationMethod(
authenticationMethod: 'email' | 'ldap' | 'saml',
): void {
export function setCurrentAuthenticationMethod(authenticationMethod: AuthProviderType): void {
config.set('userManagement.authenticationMethod', authenticationMethod);
}