Skip to content
18 changes: 18 additions & 0 deletions .changeset/32087-sso-sign-out-of-idp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@objectstack/plugin-auth': minor
'@objectstack/platform-objects': minor
---

feat(plugin-auth): an SSO provider can sign the person out of the company sign-in too, per provider and off by default

Clause-②: yes (widening) — `sys_sso_provider` gains a `sign_out_of_idp` column (boolean, default false), `/sso/register` and `/sso/update-provider` accept a `signOutOfIdp` member, the Edit Sign-In Options action gains its param, the Register SAML Provider and Edit SAML Settings actions gain an optional `logoutUrl`, and `/sso/saml2/sp/slo/:providerId` and `/sso/saml2/logout/:providerId` answer for a provider whose switch is on. Nothing that was served before is refused now; with the switch off (every existing provider) sign-out answers exactly as before.
Metadata-protocol: added

Each SSO provider has a new sign-in option, **Sign Out of the Company Sign-In Too**. It is off by default, and a change is recorded in the audit log like the other sign-in options (`trackHistory`). With it on, signing out of the platform also ends the person's session at the identity provider:

- **SAML** through single logout. Sign-out answers `{ success, url, redirect }` with the identity provider's logout URL carrying a LogoutRequest for the session that signed in, and the platform session ends. The identity provider's logout address is the new **IdP Logout URL** on Register SAML Provider and Edit SAML Settings, stored in the provider's SAML configuration as its single logout service (no new column). The provider's single logout endpoint opens only while the switch is on, and a logout message from the identity provider is accepted only when it is signed; a signed logout request ends only the session it names.
- **OIDC** through an RP-initiated logout redirect. Sign-out answers `{ success, url, redirect }` with the provider's `end_session_endpoint`, carrying the ID token of that sign-in as `id_token_hint`, the `client_id`, a `post_logout_redirect_uri` when the sign-out's `callbackURL` is on a trusted origin, and the sign-out's `state`. The endpoint is read from the provider's discovery document when the switch is saved on, and kept in its stored OIDC configuration.

Saving the switch on is refused `400 VALIDATION_FAILED` on `signOutOfIdp` for a provider that cannot honour it: a SAML provider with no IdP Logout URL, or an OIDC provider whose discovery document cannot be read or names no `end_session_endpoint` on a trusted origin. Saving it off is never refused. A sign-out through the SAML single logout writes the same logout audit row as `/sign-out`.

Not in this change: the Console sign-out following the answered `url`, and any form item the Edit Sign-In Options form does not render by itself, are a later Console change. A session started before the switch was turned on signs out of the platform only.
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,10 @@ export const arObjects: NonNullable<TranslationData['objects']> = {
label: "قراءة المطالبات من رمز المعرّف فقط",
help: "لـ OIDC فقط. تُقرأ عناوين البريد الإلكتروني والاسم والمجموعات من رمز المعرّف الذي تحقق منه موفر الهوية، ولا تُستدعى نقطة نهاية userinfo الخاصة به. فعّله لـ Microsoft Entra ID، إذ لا تتضمن استجابة userinfo لديه مجموعات ولا preferred_username. معطّل افتراضيًا: الموفر الذي لديه نقطة نهاية userinfo يقرأ مطالباته من تلك الاستجابة. غيّره عبر «تعديل خيارات تسجيل الدخول»."
},
sign_out_of_idp: {
label: "Sign Out of the Company Sign-In Too",
help: "When someone signs out, also sign them out of the identity provider, so the next sign-in through it asks for their credentials again (for shared computers). SAML: single logout, which needs the IdP Logout URL; logout messages from the identity provider are accepted only when signed. OIDC: the identity provider’s end-session endpoint, read from its discovery document. Off by default: signing out ends only this system’s session. Change it with “Edit Sign-In Options”."
},
user_id: {
label: "سجّله",
help: "المستخدم الذي سجّل هذا المزوّد"
Expand Down Expand Up @@ -2221,6 +2225,10 @@ export const arObjects: NonNullable<TranslationData['objects']> = {
helpText: "اختياري. تنسيق NameID المطلوب في SAML. القيمة الافتراضية هي التنسيق المُهيَّأ لدى مزوّد الهوية.",
placeholder: "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
},
logoutUrl: {
label: "IdP Logout URL",
helpText: "Optional. The IdP’s SAML single logout (redirect) endpoint. Needed only to turn on “Sign Out of the Company Sign-In Too” in Edit Sign-In Options."
},
mapEmail: {
label: "التعيين: سمة البريد الإلكتروني",
helpText: "اختياري. سمة التأكيد المعيَّنة لبريد المستخدم الإلكتروني. القيمة الافتراضية \"email\"، ثم NameID. Entra ID: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
Expand Down Expand Up @@ -2305,6 +2313,10 @@ export const arObjects: NonNullable<TranslationData['objects']> = {
keepCurrentCert: {
label: "الاستمرار في الوثوق بالشهادة الحالية",
helpText: "أثناء انتقال مزوّد الهوية، تُقبل التأكيدات الموقّعة بأيٍّ من الشهادتين. عدّل مرة أخرى دون هذا الخيار لإزالة الشهادة القديمة."
},
logoutUrl: {
label: "IdP Logout URL",
helpText: "The IdP’s SAML single logout (redirect) endpoint, used when “Sign Out of the Company Sign-In Too” is on. Leave blank to keep the stored one."
}
},
resultDialog: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ export const arGeneratedSourceHashes: Readonly<Record<string, string>> = {
"objects.sys_platform_setting_audit.fields.source.options.api": "4baeeff968e192d1",
"objects.sys_setting_audit.fields.source.options.api": "4baeeff968e192d1",
"objects.sys_sso_provider._actions.edit_oidc_provider.params.scopes.placeholder": "58ac90cde28c764d",
"objects.sys_sso_provider._actions.edit_saml_provider.params.logoutUrl.helpText": "e12c82bcc5ee4470",
"objects.sys_sso_provider._actions.edit_saml_provider.params.logoutUrl.label": "f1c66037f3f34cf9",
"objects.sys_sso_provider._actions.edit_sso_attribute_mapping.params.email.placeholder": "66309c7adf5c9436",
"objects.sys_sso_provider._actions.edit_sso_attribute_mapping.params.firstName.placeholder": "27291cee7a635764",
"objects.sys_sso_provider._actions.edit_sso_attribute_mapping.params.lastName.placeholder": "32ce377ac4d7e610",
"objects.sys_sso_provider._actions.edit_sso_attribute_mapping.params.name.placeholder": "dc543ca3ca90e5f1",
"objects.sys_sso_provider._actions.edit_sso_groups_claim.params.groupsClaim.placeholder": "833cddda1a6e25f9",
"objects.sys_sso_provider._actions.register_saml_provider.params.identifierFormat.placeholder": "5945ff9a6b644855",
"objects.sys_sso_provider._actions.register_saml_provider.params.logoutUrl.helpText": "733cd3b080694925",
"objects.sys_sso_provider._actions.register_saml_provider.params.logoutUrl.label": "f1c66037f3f34cf9",
"objects.sys_sso_provider._actions.register_saml_provider.params.mapEmail.placeholder": "66309c7adf5c9436",
"objects.sys_sso_provider._actions.register_saml_provider.params.mapFirstName.placeholder": "27291cee7a635764",
"objects.sys_sso_provider._actions.register_saml_provider.params.mapGroups.placeholder": "833cddda1a6e25f9",
Expand All @@ -69,4 +73,6 @@ export const arGeneratedSourceHashes: Readonly<Record<string, string>> = {
"objects.sys_sso_provider._actions.register_sso_provider.params.mapGroups.placeholder": "833cddda1a6e25f9",
"objects.sys_sso_provider._actions.register_sso_provider.params.mapName.placeholder": "a484c34aaf624bd6",
"objects.sys_sso_provider._actions.register_sso_provider.params.scopes.placeholder": "58ac90cde28c764d",
"objects.sys_sso_provider.fields.sign_out_of_idp.help": "ab8ff5fce3001c81",
"objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b",
};
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,10 @@ export const deObjects: NonNullable<TranslationData['objects']> = {
label: "Claims nur aus dem ID-Token lesen",
help: "Nur OIDC. Liest E-Mail-Adresse, Name und Gruppen aus dem verifizierten ID-Token des Identitätsanbieters und ruft dessen Userinfo-Endpunkt nicht auf. Für Microsoft Entra ID einschalten: Dessen Userinfo-Antwort enthält keine Gruppen und kein preferred_username. Standardmäßig aus: Ein Anbieter mit Userinfo-Endpunkt liest seine Claims aus dieser Antwort. Änderung über „Anmeldeoptionen bearbeiten“."
},
sign_out_of_idp: {
label: "Sign Out of the Company Sign-In Too",
help: "When someone signs out, also sign them out of the identity provider, so the next sign-in through it asks for their credentials again (for shared computers). SAML: single logout, which needs the IdP Logout URL; logout messages from the identity provider are accepted only when signed. OIDC: the identity provider’s end-session endpoint, read from its discovery document. Off by default: signing out ends only this system’s session. Change it with “Edit Sign-In Options”."
},
user_id: {
label: "Registriert von",
help: "Benutzer, der diesen Anbieter registriert hat"
Expand Down Expand Up @@ -2221,6 +2225,10 @@ export const deObjects: NonNullable<TranslationData['objects']> = {
helpText: "Optional. Angefordertes SAML-NameID-Format. Standard ist das im IdP konfigurierte Format.",
placeholder: "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
},
logoutUrl: {
label: "IdP Logout URL",
helpText: "Optional. The IdP’s SAML single logout (redirect) endpoint. Needed only to turn on “Sign Out of the Company Sign-In Too” in Edit Sign-In Options."
},
mapEmail: {
label: "Zuordnung: E-Mail-Attribut",
helpText: "Optional. Assertion-Attribut, das der E-Mail-Adresse des Benutzers zugeordnet wird. Standard ist „email“, danach die NameID. Entra ID: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
Expand Down Expand Up @@ -2305,6 +2313,10 @@ export const deObjects: NonNullable<TranslationData['objects']> = {
keepCurrentCert: {
label: "Dem aktuellen Zertifikat weiter vertrauen",
helpText: "Während der IdP umstellt, werden Assertions akzeptiert, die mit einem der beiden Zertifikate signiert sind. Erneut ohne diese Option bearbeiten, um das alte zu entfernen."
},
logoutUrl: {
label: "IdP Logout URL",
helpText: "The IdP’s SAML single logout (redirect) endpoint, used when “Sign Out of the Company Sign-In Too” is on. Leave blank to keep the stored one."
}
},
resultDialog: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,16 @@ export const deGeneratedSourceHashes: Readonly<Record<string, string>> = {
"objects.sys_setting_audit.fields.source.options.migration": "477a479630b97ad5",
"objects.sys_setting_audit.fields.source.options.system": "d2c13a5a8c70ea8d",
"objects.sys_sso_provider._actions.edit_oidc_provider.params.scopes.placeholder": "58ac90cde28c764d",
"objects.sys_sso_provider._actions.edit_saml_provider.params.logoutUrl.helpText": "e12c82bcc5ee4470",
"objects.sys_sso_provider._actions.edit_saml_provider.params.logoutUrl.label": "f1c66037f3f34cf9",
"objects.sys_sso_provider._actions.edit_sso_attribute_mapping.params.email.placeholder": "66309c7adf5c9436",
"objects.sys_sso_provider._actions.edit_sso_attribute_mapping.params.firstName.placeholder": "27291cee7a635764",
"objects.sys_sso_provider._actions.edit_sso_attribute_mapping.params.lastName.placeholder": "32ce377ac4d7e610",
"objects.sys_sso_provider._actions.edit_sso_attribute_mapping.params.name.placeholder": "dc543ca3ca90e5f1",
"objects.sys_sso_provider._actions.edit_sso_groups_claim.params.groupsClaim.placeholder": "833cddda1a6e25f9",
"objects.sys_sso_provider._actions.register_saml_provider.params.identifierFormat.placeholder": "5945ff9a6b644855",
"objects.sys_sso_provider._actions.register_saml_provider.params.logoutUrl.helpText": "733cd3b080694925",
"objects.sys_sso_provider._actions.register_saml_provider.params.logoutUrl.label": "f1c66037f3f34cf9",
"objects.sys_sso_provider._actions.register_saml_provider.params.mapEmail.placeholder": "66309c7adf5c9436",
"objects.sys_sso_provider._actions.register_saml_provider.params.mapFirstName.placeholder": "27291cee7a635764",
"objects.sys_sso_provider._actions.register_saml_provider.params.mapGroups.placeholder": "833cddda1a6e25f9",
Expand All @@ -204,6 +208,8 @@ export const deGeneratedSourceHashes: Readonly<Record<string, string>> = {
"objects.sys_sso_provider._actions.register_sso_provider.params.scopes.placeholder": "58ac90cde28c764d",
"objects.sys_sso_provider._actions.request_domain_verification.resultDialog.fields.dnsRecordName": "b9fb79397650d504",
"objects.sys_sso_provider.fields.id.label": "00b0385c9c152888",
"objects.sys_sso_provider.fields.sign_out_of_idp.help": "ab8ff5fce3001c81",
"objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b",
"objects.sys_team.fields.name.label": "5274417ff1ccaf01",
"objects.sys_team.label": "42b87165ac826b2b",
"objects.sys_team.pluralLabel": "3fe8519872f65108",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,10 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
label: "Read Claims From the ID Token Only",
help: "OIDC only. Read the email, name and groups from the identity provider’s verified ID token and do not call its userinfo endpoint. Turn it on for Microsoft Entra ID, whose userinfo answer carries no groups and no preferred_username. Off by default: a provider with a userinfo endpoint reads its claims from that answer. Change it with “Edit Sign-In Options”."
},
sign_out_of_idp: {
label: "Sign Out of the Company Sign-In Too",
help: "When someone signs out, also sign them out of the identity provider, so the next sign-in through it asks for their credentials again (for shared computers). SAML: single logout, which needs the IdP Logout URL; logout messages from the identity provider are accepted only when signed. OIDC: the identity provider’s end-session endpoint, read from its discovery document. Off by default: signing out ends only this system’s session. Change it with “Edit Sign-In Options”."
},
user_id: {
label: "Registered By",
help: "User who registered this provider"
Expand Down Expand Up @@ -2221,6 +2225,10 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
helpText: "Optional. Requested SAML NameID format. Defaults to the IdP’s configured format.",
placeholder: "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
},
logoutUrl: {
label: "IdP Logout URL",
helpText: "Optional. The IdP’s SAML single logout (redirect) endpoint. Needed only to turn on “Sign Out of the Company Sign-In Too” in Edit Sign-In Options."
},
mapEmail: {
label: "Map: Email attribute",
helpText: "Optional. Assertion attribute mapped to the user’s email. Defaults to \"email\", then the NameID. Entra ID: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
Expand Down Expand Up @@ -2305,6 +2313,10 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
keepCurrentCert: {
label: "Keep trusting the current certificate",
helpText: "While the IdP switches over, accept assertions signed by either certificate. Edit again without this to drop the old one."
},
logoutUrl: {
label: "IdP Logout URL",
helpText: "The IdP’s SAML single logout (redirect) endpoint, used when “Sign Out of the Company Sign-In Too” is on. Leave blank to keep the stored one."
}
},
resultDialog: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,10 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
label: "Leer las notificaciones solo del token de ID",
help: "Solo OIDC. Lee el correo electrónico, el nombre y los grupos del token de ID verificado del proveedor de identidad y no llama a su endpoint userinfo. Actívalo para Microsoft Entra ID, cuya respuesta de userinfo no incluye grupos ni preferred_username. Desactivado de forma predeterminada: un proveedor con endpoint userinfo lee sus notificaciones de esa respuesta. Cámbialo con «Editar opciones de inicio de sesión»."
},
sign_out_of_idp: {
label: "Sign Out of the Company Sign-In Too",
help: "When someone signs out, also sign them out of the identity provider, so the next sign-in through it asks for their credentials again (for shared computers). SAML: single logout, which needs the IdP Logout URL; logout messages from the identity provider are accepted only when signed. OIDC: the identity provider’s end-session endpoint, read from its discovery document. Off by default: signing out ends only this system’s session. Change it with “Edit Sign-In Options”."
},
user_id: {
label: "Registrado por",
help: "Usuario que registró este proveedor"
Expand Down Expand Up @@ -2221,6 +2225,10 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
helpText: "Opcional. Formato de NameID SAML solicitado. Por defecto, el formato configurado en el IdP.",
placeholder: "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
},
logoutUrl: {
label: "IdP Logout URL",
helpText: "Optional. The IdP’s SAML single logout (redirect) endpoint. Needed only to turn on “Sign Out of the Company Sign-In Too” in Edit Sign-In Options."
},
mapEmail: {
label: "Mapeo: atributo de correo",
helpText: "Opcional. Atributo de la aserción asignado al correo del usuario. Por defecto, «email» y, si falta, el NameID. Entra ID: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
Expand Down Expand Up @@ -2305,6 +2313,10 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
keepCurrentCert: {
label: "Seguir confiando en el certificado actual",
helpText: "Mientras el IdP hace el cambio, aceptar aserciones firmadas con cualquiera de los dos certificados. Vuelva a editar sin esta opción para quitar el antiguo."
},
logoutUrl: {
label: "IdP Logout URL",
helpText: "The IdP’s SAML single logout (redirect) endpoint, used when “Sign Out of the Company Sign-In Too” is on. Leave blank to keep the stored one."
}
},
resultDialog: {
Expand Down
Loading
Loading