Skip to content

Refresh override script cache before password overwrite in XCredsCreateUser - #382

Open
07-C9 wants to merge 1 commit into
twocanoes:developfrom
07-C9:develop
Open

Refresh override script cache before password overwrite in XCredsCreateUser#382
07-C9 wants to merge 1 commit into
twocanoes:developfrom
07-C9:develop

Conversation

@07-C9

@07-C9 07-C9 commented Apr 9, 2026

Copy link
Copy Markdown

Updating this PR. After more testing, I realized the first version of the fix doesn't help if LAPS rotates while at the XCreds login window, and then a user goes to login with a changed IdP password.

Moved refreshCachedPrefs() to XCredsCreateUser, right before a password overwrite is needed. It only runs during PasswordOverwriteSilent when a password mismatch is detected, so normal logins are unaffected. Existing set-admin-user workflows are also unaffected.

Tested by rotating LAPS while at the login window, then logging in with a changed cloud password. Password overwrite succeeded with the post-rotation creds:

2026-04-29 11:13:54.000 Df authorizationhosthelper.arm64[7536:4d834d] (XCredsLoginPlugin) XCREDS_LOG:      DefaultsOverride.swift:32 refreshCachedPrefs() Pref script defined at /usr/local/bin/xcreds_override.sh
2026-04-29 11:13:54.459 A  authorizationhosthelper.arm64[7536:4d834d] (CFOpenDirectory) Change the credential used to operate on a record
2026-04-29 11:13:54.646 A  authorizationhosthelper.arm64[7536:4d834d] (CFOpenDirectory) Change password for record

Without this fix, the same test fails with stale cached credentials.

@07-C9 07-C9 changed the title Refresh override script cache before admin credentials check Refresh override script cache before password overwrite in XCredsCreateUser Apr 30, 2026
@PeetMcK

PeetMcK commented May 20, 2026

Copy link
Copy Markdown

Big +1 here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants