diff --git a/packages/console/src/pages/ApplicationDetails/SamlApplicationDetailsContent/utils.ts b/packages/console/src/pages/ApplicationDetails/SamlApplicationDetailsContent/utils.ts index 4703d73cf..8e4c71560 100644 --- a/packages/console/src/pages/ApplicationDetails/SamlApplicationDetailsContent/utils.ts +++ b/packages/console/src/pages/ApplicationDetails/SamlApplicationDetailsContent/utils.ts @@ -21,7 +21,7 @@ export const parseSamlApplicationResponseToFormData = ( nameIdFormat, encryptSamlAssertion: encryption?.encryptAssertion ?? false, encryptThenSignSamlAssertion: encryption?.encryptThenSign ?? false, - certificate: encryption?.certificate, + certificate: encryption?.certificate ?? '', }; }; @@ -55,14 +55,19 @@ export const parseFormDataToSamlApplicationRequest = ( acsUrl: acsUrlData, nameIdFormat, ...cond( - encryptSamlAssertion && - certificate && { - certificate: { - encryptAssertion: encryptSamlAssertion, - certificate, - encryptThenSign: encryptThenSignSamlAssertion, - }, - } + encryptSamlAssertion + ? cond( + certificate && { + encryption: { + encryptAssertion: encryptSamlAssertion, + certificate, + encryptThenSign: encryptThenSignSamlAssertion, + }, + } + ) + : { + encryption: null, + } ), }), }; diff --git a/packages/schemas/src/foundations/jsonb-types/saml-application-configs.ts b/packages/schemas/src/foundations/jsonb-types/saml-application-configs.ts index 2fc078106..5dc2f9307 100644 --- a/packages/schemas/src/foundations/jsonb-types/saml-application-configs.ts +++ b/packages/schemas/src/foundations/jsonb-types/saml-application-configs.ts @@ -51,14 +51,14 @@ export const samlEncryptionGuard = z export type SamlEncryption = z.input; export enum NameIdFormat { - /** The Identity Provider can determine the format. */ - Unspecified = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', - /** Returns the email address of the user. */ - EmailAddress = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress', /** Uses unique and persistent identifiers for the user. */ Persistent = 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent', + /** Returns the email address of the user. */ + EmailAddress = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress', /** Uses unique and transient identifiers for the user, which can be different for each session. */ Transient = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient', + /** The Identity Provider can determine the format. */ + Unspecified = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', } export const nameIdFormatGuard = z.nativeEnum(NameIdFormat);