Skip to content

bug(platform): teams keep arriving from the identity provider while "Sync IdP groups to teams" is off #5138

Open

Description

@yannickmonney

Summary

The pilot turned Sync IdP groups to teams off and still sees teams synchronized. The teams the sync had created are still there, and a group created in the IdP afterwards appeared as a team. The switch gates exactly one path: group-to-team sync at an SSO sign-in. Two other paths create teams from IdP groups without reading it: SCIM Group provisioning and the trusted-headers door. The Teams list gives teams from SSO sync and from SCIM the same Synced badge, so an admin cannot tell which door made a team. Whether the pilot has SCIM provisioning on was not captured; it is the explanation the code supports best.

The report

Obwohl die Funktion "IdP-Gruppen mit Teams synchronisieren" ausgeschaltet ist, werden bestehende Sync-Gruppen und neue Gruppen (z. B. eine neue Testgruppe) synchronisiert.

"Although 'Sync IdP groups to teams' is switched off, existing sync groups and new groups (e.g. a new test group) are synchronized." The group's name is left out here. It followed the pattern <prefix>.Tale.<role>-Test.

What the repository says (main at b2560c2d7)

The switch, and where it is read.

  • Label and description: "Creates and updates teams from the IdP's group memberships at sign-in." (services/platform/messages/en/settings.yml:635-636; German services/platform/messages/de/settings.yml:654-655). The form maps it at services/platform/app/features/settings/enterprise-sso/components/enterprise-sso-form.tsx:501 and :519.
  • It is saved as provisioning.autoProvisionTeam in the connection file (services/platform/backend/domains/sso/admin.ts:131-141) and read with the default false (services/platform/backend/domains/sso/config.ts:222-237).
  • At an SSO sign-in (OIDC and SAML share handleSsoLogin; SAML at services/platform/backend/core/enterprise_sso/saml/acs_handler.ts:177), groups are fetched only when the switch or a group role rule needs them (services/platform/backend/core/enterprise_sso/login/callback_handler.ts:350-364). syncTeamsFromGroupNames runs only if (config.autoProvisionTeam && args.groups?.length) (services/platform/backend/domains/sso/service.ts:626-641).

Paths that do not read it.

  • SCIM Groups. The SCIM door checks only that SCIM is enabled for the token (services/platform/backend/domains/scim/routes.ts:81-84). POST /Groups creates a team (services/platform/backend/core/scim/http_actions.ts:274-298, then services/platform/backend/domains/scim/service.ts:923-972), and PATCH and PUT change its members. Neither autoProvisionTeam nor Exclude groups appears anywhere under domains/scim/ or core/scim/. An IdP such as Entra pushes every group assigned to the enterprise application on each provisioning cycle, so a new group assigned there becomes a team without anyone signing in.
  • Trusted headers. A proxy's teams header is synced on every hand-off, with excludeGroups: [] and no switch (services/platform/backend/domains/sso/trusted-headers.ts:270-289).

Turning the switch off does nothing to existing teams. The save writes only the connection file. The provenance rows that mark teams the sync created (app.sso_synced_teams, migration 0071) stay; domains/sso/admin.ts never touches them. The Teams list computes synced from that provenance or a SCIM Group link (services/platform/backend/domains/teams/routes.ts:138-166). It shows Synced (settings.yml:342) and opens such a team read-only: "This team is provisioned by your identity provider, which owns its name and members. Change them there; a local edit would be undone by the next sync." (settings.yml:343-345; services/platform/app/features/settings/teams/components/team-edit-dialog.tsx:66-69, :307-324). With the switch off, no next sync runs. The teams keep the badge, stay read-only in Tale, and their members no longer follow the IdP. Delete still works.

Docs and spec.

  • docs/en/platform/admin/enterprise-sso.md:64 describes the switch as "Creates or joins teams from group membership at sign-in". The SCIM section (:71-79) maps "Groups to teams" and does not say that the switch and the exclusions do not apply to it.
  • The SSO spec's team-sync rules, SSO-R6 to SSO-R9 (services/platform/backend/domains/sso/spec.md:74-107), say nothing about the switch being off. No backend test calls handleSsoLogin with autoProvisionTeam: false and checks that no team appears.

Hypotheses, ranked by how well the code supports them

  1. SCIM provisioning is on and the IdP pushes its assigned groups. This explains the new groups and teams that change while nobody signs in. To settle it: Settings › Enterprise SSO › SCIM provisioning shows Enabled, and the audit log holds scim_provision_group entries (domains/scim/service.ts:951-958).
  2. The teams seen are earlier sync results, still badged Synced and read-only after the switch went off. This explains the existing groups, not the new one.
  3. A trusted proxy sends a teams header. Applies only if the pilot uses the trusted-headers door.
  4. The switch did not save. The code read above does not support this. To settle it, read provisioning.autoProvisionTeam in the organization's SSO connection file.

What was not examined

  • The pilot's setup: SCIM on or off, the IdP, which groups are assigned, when the switch went off.
  • A live Entra provisioning cycle.

Options (no preference stated)

  1. Say it. The switch's description, the SCIM card and the docs state that SCIM Groups always become teams and that the switch covers sign-in only, and the Teams list shows which door made each team.
  2. Make SCIM Group provisioning obey the switch and the exclusions, so one setting decides whether groups become teams through either door.
  3. A separate switch for SCIM Groups (users only, or users and groups).
  4. Decide what turning the switch off does to teams the sync made: keep them but make them editable (drop the provenance), keep them read-only, or offer to remove them.

Questions for the reporter

  • Is SCIM provisioning enabled for the organization, and which groups are assigned to the enterprise application in the IdP?
  • Did the new group appear without the test user signing in?
  • Does the organization use the trusted-headers door?

Related

#4774 (SCIM group PATCH ignores operation order), #2116, #2085, #5044 (pilot findings).

Activity

  1. added
    priority: medium
    needs discussion
    bug
    service: platform
    on Oct 30, 2026
  2. yannickmonney commented on Oct 30, 2026

    @yannickmonney
    ContributorAuthor

    The reporter's answers, 2026-10-30:

    • SCIM provisioning is on for the organization. That makes hypothesis 1 the working explanation. The SCIM door creates and updates a team for every group the IdP pushes, and checks neither the switch nor Exclude groups.
    • Unknown: whether the new group appeared before or after the test user signed in.

    The timing is not needed to tell the doors apart, because the audit log names the door that created a team. Look under Settings › Governance › Logs for the team's creation (category member, resource type team):

    Door Action Actor Where it is written
    SCIM scim_provision_group scim (type api) services/platform/backend/domains/scim/service.ts:177-204, :951-958
    Sign-in sync (the trusted-headers door uses the same function) team.created, metadata door: sso sso (type system) services/platform/backend/domains/teams/audit.ts:26, :51-62; services/platform/backend/domains/sso/service.ts:368-374

    A scim_provision_group row for the new team is the SCIM path described above. A team.created row by sso dated after the switch went off would contradict the code read in this issue (hypotheses 3 and 4) and needs its own look.

    One more gap found while checking this, now tracked in #5142: the settings form saves through PUT /config/oidc or /config/saml (services/platform/app/features/settings/enterprise-sso/components/enterprise-sso-form.tsx:529, :554). The sso_configure audit row those saves write records only { protocol, providerId } or { protocol: 'saml' } (services/platform/backend/domains/sso/admin.ts:252-255, :325-327). The provisioning-only route records { provisioning: true } (:349-351). None records the switch's value or a previous state, so the log can show that the settings were saved but not when team sync was turned off. Only the connection file holds the current value.

    Edited 2026-10-30: the first version of this paragraph cited the provisioning-only route as the form's save path.

  3. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    Decision

    Rule: each door that turns IdP groups into teams is scoped where it is configured. Tale shows which door owns each team. Ending sign-in team sync hands its teams over to the admins.

    • Sync IdP groups to teams and Exclude groups govern only the SSO sign-in door. The copy, docs and spec will say so.
    • SCIM: the IdP's provisioning scope decides which groups become teams (Entra's group assignment or its Groups mapping, Okta's Push Groups). Tale adds no SCIM group switch.
    • Trusted headers: the proxy decides by sending, or not sending, the teams header.
    • Badges: the Teams list shows the door on each provisioned team: SCIM, SSO sign-in or Trusted proxy, in place of one generic Synced badge.
    • Release: turning the switch off, or removing the SSO connection, releases the teams and memberships the sign-in sync created. They stay in place as ordinary editable teams, and nothing is deleted. A group newly added to Exclude groups releases its team the same way. A confirmation shows the counts first. Each released team gets an audit row.
    • Pauses: pausing SSO or the proxy releases nothing.
    • Existing records: records written before this change are attributed to SSO sign-in where the proxy cannot have written them. Where it could have, either door may still clean them up, so a person who leaves a group at the proxy still loses the team.

    Answers

    • Should SCIM obey the switch and exclusions? No. Enforcing that means refusing group requests, which can quarantine the IdP's provisioning job and stop user deactivations.
    • Should trusted headers obey them? No. That door works without an SSO connection, where the switch is off by default.
    • A separate SCIM group switch? No, for the same reason. The IdP's scope already does this.
    • What happens to existing synced teams on switch-off? They are released, not left read-only and not deleted.
    • Can a sign-in that is already running undo a release? No. The sign-in sync re-checks the switch under the same lock the save holds.
    • Reporter questions:
      • SCIM is on, which explains the new group.
      • The timing is not needed, because the audit row names the door.
      • Trusted-headers use was not captured, and the decision does not depend on it.

    Rationale

    Changes here must not break user deprovisioning or widen who can see restricted items. That rules out refusing SCIM traffic and deleting teams. It also rules out attributing every existing record to SSO, which would stop the proxy from removing access it granted. Naming the door and stating each control's scope fixes the confusion, and releasing provenance ends the read-only-but-never-updated state. The release runs under the configuration's write lock, so a failed save releases nothing.

    Implementation units (all on main)

    1. Docs and copy (S). Switch and SCIM card copy in en, de, de-CH and fr. IdP scoping steps in the docs. Two spec rules. Tests that sign-in with the switch off creates no team and that SCIM still creates teams.
    2. Door column (M). Migration adding door ('sso', 'proxy' or 'legacy') to both provenance tables, with a backfill that keeps proxy-granted records prunable. Each door cleans up only its own and legacy records. SSO-R7 amended.
    3. Teams list names the door (M). Source per team, a badge and read-only notice per door, docs, a manual test box. Depends on 2.
    4. Release on switch-off, removal or exclusion (M). Runs under the configuration's write lock. Preview endpoint, confirmation dialog, team.sync_released audit rows, sign-in re-check, spec rule, docs, manual test box. Depends on 2.

    Cross-issue amendments (decisions taken together with #5412):

  4. added
    agent-ready
    and removed
    needs discussion
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugpriority: mediumservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions