Repository navigation
Conversation
…vates users. SSO sign-in stops creating accounts while sync is on, and a managed account no longer takes its name, email, or role from the token. The last role manager stays active. Co-authored-by: craig-dt <craig@deeptempo.ai>
craig-dt
deleted the
cursor/factory-4423-directory-sync-turns-on-and-a-pushed-user-is-created-taken-over-disabled-and-sign-b566
branch
November 16, 2026 06:15
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4423
A provider can push people into Vigil. Turning directory sync on from Single sign-on mints one token for a service account that holds only
directory.sync. While sync is on, sign-in does not create accounts and does not link by email. A push creates a passwordless person, or takes over the account whoseexternalIdis already on a link.active: falseand DELETE deactivate throughdeactivate_accountwith routesync. The account leaves SCIM and stays in Vigil. The last person who can manage roles stays active, and that refusal is listed on the card until it no longer applies.SCIM is
/scim/v2. Compose publishes the backend itself, so that path reaches the API. A GET that misses is JSON, not the app shell.python -m core.auth.directory_sync_offturns sync off and leaves the token in place. Sign-in can create accounts again. A placeholder subject (still the externalId) is replaced with the token'ssubon the first real sign-in, including after sync is off, so an Entraoiddoes not strand that person.Left for a follow-up, as the groom scoped: the pending-push table, linking a push to an existing person, reactivating a window of sync deactivations, and removing a never-used sync account.
Directory sync on, with a refused last-manager deactivation
Quill deactivated by directory sync
Verification
Ran
vgl_api_token once. The card then showed sync on, no push yet, a token expiry about a year out, and/scim/v2./scim/v2/Usersreturned 201 for Quill. Signing in through a local OpenID Connect provider landed in the console as that account. PATCHactiveto false returned 200; the next/api/auth/mewith that session was 403 and the browser returned to the login screen.scimType: uniqueness. One account remained.active: falseon the last role manager returned 409, left the account active, and listedquill.useron the sync card (1920 and 360). A retry that also renamed them still returned 409 and did not keep the rename or move the version.directory.syncdisabled, with "not grantable", at 1920 and 360.python -m core.auth.directory_sync_offwith a reason turned sync off and said the token was left in place. An SSO sign-in for someone the push had never created then creatednova.userand opened the console.oid-erna) and whose tokensubwas different signed in, replaced the subject withsub, leftdirectory_idand the stored name unchanged.Authorizationheader, and noexternalIdor display name from the request body.Did not run
Blocked by the machine
.envsetsVIGIL_COOKIE_SECURE=true, so the HTTP console on this machine refused the CSRF cookie until the API was started withVIGIL_COOKIE_SECURE=false.VIGIL_FRONTEND_URLwas empty, so the SSO callback went to the API port and the sign-in cookie, set on the web port, was missing (no_state_cookie). The live sign-in usedVIGIL_FRONTEND_URL=http://127.0.0.1:6988.0074_directory_syncneededVIGIL_UPGRADE_ACK_VERSIONandVIGIL_UPGRADE_ACK_REASON. The API worker that reloaded before that upgrade exited on the schema mismatch and stayed a zombie until that process was restarted.To show artifacts inline, enable in settings.