0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-03 21:48:55 -05:00

fix: fix SAML app console issues (#6969)

This commit is contained in:
Darcy Ye 2025-01-22 17:31:30 +08:00 committed by GitHub
parent e2d6302d58
commit 2633723861
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 13 deletions

View file

@ -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,
}
),
}),
};

View file

@ -51,14 +51,14 @@ export const samlEncryptionGuard = z
export type SamlEncryption = z.input<typeof samlEncryptionGuard>;
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);