Skip to content

Improvement: SSO team sync should not turn every identity-provider group of a person signing in into a team #5412

Open

Description

@yannickmonney

Summary

With Sync IdP groups to teams on, a person's SSO sign-in turns every group the identity provider reports for them into a team: missing teams are created, and the person joins each one. With Microsoft Entra ID that means every group in Microsoft Graph's /me/memberOf, up to 50 pages of 100. The only limit is a list of group names to leave out.

Reported: syncing teams took over the users' groups, so a new user's SSO sign-in synced all of them, and this should not happen. Details of the affected organization are left out of this issue.

The behaviour is what the SSO spec states (SSO-R6 to SSO-R9), so changing it changes those rules and their tests. #5138 covers the other side: teams that keep arriving while the switch is off, through SCIM.

Anchors are on main at 3d802f94f.

What the code does

  • Groups are read at sign-in when the switch or a group role rule needs them and the token carried none (callback_handler.ts:350-364). For Entra this is /me/memberOf?$select=id,displayName, every page up to GRAPH_MAX_PAGES = 50, keeping each #microsoft.graph.group entry (entra_id/adapter.ts:190-258). Only the display names go on (callback_handler.ts:360).
  • Every group not excluded becomes a team. syncTeamsFromGroupNames finds a team by the group's name, with case and spacing folded, or creates it. It adds the person, records that the sync made the team and the membership, and writes audit rows (sso/service.ts:276-416).
  • It runs on every sign-in while the switch is on (sso/service.ts:626-641). A trusted proxy's teams header runs the same sync with no switch and no exclusions (trusted-headers.ts:270-289).
  • The switch is off by default (sso/config.ts:222-237). The form calls it "Sync IdP groups to teams — Creates and updates teams from the IdP's group memberships at sign-in.", with "Exclude groups — Comma-separated group names to skip during team sync." (settings.yml:715-718); the docs say the same (enterprise-sso.md:58-71).
  • The spec has SSO-R6 "Team sync gives a person the teams named by their groups", SSO-R7 (takes away only what it gave), SSO-R8 (an excluded group is left alone) and SSO-R9 (audit) (sso/spec.md:95-128).
  • A synced team is read-only in Tale: the identity provider owns its name and roster (team-edit-dialog.tsx:66-69).

What follows from this:

  • An exclusion list has to name every unwanted group in advance. A group that is new in the identity provider becomes a team at the next sign-in of any of its members.
  • A team is matched by its display name, not its ID. A renamed group becomes a second team, and the old one goes only when its last synced member has left (SSO-R7).
  • Teams are what projects and skills are shared with, so the created teams also appear wherever a team is picked.

Not examined

The affected organization's setup: the identity provider, how many groups a person has, which of them became teams, and whether SCIM is on as well (#5138). No live Entra tenant was used.

Options

None is preferred; several combine.

  • A. An allow-list: sync only the groups an admin names, instead of, or beside, the exclusions.
  • B. Never create a team at sign-in: join only teams that exist, or that an admin linked to a group by its ID.
  • C. For Entra, read only the groups assigned to the enterprise application (the token's groups claim set to "Groups assigned to the application") instead of every group from /me/memberOf.
  • D. Sync only some kinds of group (for example security groups, not Microsoft 365 or distribution groups).
  • E. Match groups by their ID, so a rename stays the same team.
  • F. A way to clean up teams the sync already created: remove them, or hand them to the admins as ordinary teams.
  • G. One rule for every door: the switch and the group list apply to trusted headers and SCIM too (bug(platform): teams keep arriving from the identity provider while "Sync IdP groups to teams" is off #5138).

Questions

  1. Should a sign-in create teams at all, or only join teams an admin set up?
  2. An allow-list, or a mapping from a group to a team?
  3. What should happen to the teams already created in organizations that had the switch on?
  4. Should SCIM and the trusted-headers door follow the same rule?

Related

Activity

  1. added
    needs discussion
    improvement
    service: platform
    on Nov 6, 2026
  2. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    Decision

    Signing in never creates a team. The "Sync IdP groups to teams" switch and "Exclude groups" are replaced by group links. An admin links one identity-provider group, by its stable ID, to an existing Tale team. At sign-in a person joins the teams linked to the groups they hold. Each grant is recorded per link, so a membership is removed only when no linked group still grants it. Deleting a link removes the memberships it alone granted right away. A group no link names is ignored, and Tale never matches a team by its name. Sign-in never creates or deletes a team.

    • Group ID per door: the Entra object ID (nested groups included); the trusted proxy's team id; the value the SAML or OIDC groups claim sends.
    • Memberships an admin granted are never touched. A new link applies at each person's next sign-in. Removing an IdP-granted member is allowed, with a warning that the next sign-in adds them back while they hold the group.
    • A link cannot point at a team SCIM manages. Deleting a team deletes its links.

    Answers

    1. Should a sign-in create teams? No. It only adds people to linked teams and removes them again.
    2. Allow-list or mapping? A mapping by group ID. It works as an allow-list too and survives a renamed group.
    3. What about teams the old sync created? Nothing is deleted automatically. They become ordinary admin teams, and a one-time review list offers Link to a group, Keep as an ordinary team, or Delete (with a confirmation that says what the team is shared with).
    4. SCIM and trusted headers? Trusted headers follow the same links by team id. SCIM does not; its switch is decided in bug(platform): teams keep arriving from the identity provider while "Sync IdP groups to teams" is off #5138.
    5. Group role rules? They match group names too, which is the same hole at a higher privilege. A separate issue is filed so they match by ID; this change keeps them working.

    Why

    Teams decide who sees projects and skills, and in Entra any user can create a group. Matching by name lets such a group join an admin's team. An explicit link by ID, made by an admin, closes this, and recording each grant per link makes revocation exact. Existing teams hold shares, so they are kept, and removing one stays an audited choice made by an admin.

    Implementation units (base: main)

    1. Spec: rewrite SSO-R6 to R8, keep R9, and add rules for trusted headers, SCIM-managed teams, and the review of old teams. (S)
    2. Group links: storage and admin API: link and per-link grant tables; create, list and delete; refusal codes; deleting a link revokes at once, with audit entries; team and member removal clean up. (M)
    3. Sign-in and trusted-header sync through links: no team is created or deleted; Entra IDs through the transitive Graph fallback; the old switch is ignored on read and dropped on save. (M)
    4. Teams from the old sync: release them, plus the review list. (M)
    5. Group links settings UI, en/de/de-CH/fr, docs, and a manual test box. (M)

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

  3. 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-readyimprovementservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions