feat(sso): add support for identityProviderId in SAML flow (#9411)

Updated SAML callback URLs and relevant logic to include
identityProviderId, ensuring better handling of multiple identity
providers. Refactored client and server-side code to streamline form
interactions and validation within the SSO module.

Fix https://github.com/twentyhq/twenty/issues/9323
https://github.com/twentyhq/twenty/issues/9325
This commit is contained in:
Antoine Moreaux
2025-01-07 10:30:13 +01:00
committed by GitHub
parent 9392acbee5
commit 00e71477d3
6 changed files with 31 additions and 30 deletions

View File

@ -155,11 +155,11 @@ export class SSOService {
}
buildCallbackUrl(
identityProvider: Pick<WorkspaceSSOIdentityProvider, 'type'>,
identityProvider: Pick<WorkspaceSSOIdentityProvider, 'type' | 'id'>,
) {
const callbackURL = new URL(this.environmentService.get('SERVER_URL'));
callbackURL.pathname = `/auth/${identityProvider.type.toLowerCase()}/callback`;
callbackURL.pathname = `/auth/${identityProvider.type.toLowerCase()}/callback/${identityProvider.id}`;
return callbackURL.toString();
}