The Expired Secret
Every night the HR system creates accounts for new starters and disables leavers. Last night it didn't. Three people start this morning and have no accounts, and someone who left yesterday still does.
Three locks to open
- 1Find the cause. Why can't the HR system sign in to Microsoft Entra ID?
- 2Fix it. Give the HR system a working credential, on the right app.
- 3Prove it. Run the sync and show it works.
Three new starters are in reception and none of them can log in. They were all in the HR system by Friday.
The HR sync has a status page saying 'Authentication failed' and nothing else. It runs as an app in Entra, I think? There are a few with similar names.
You escaped The Expired Secret
What happened
The HR system signs in to Microsoft Entra ID as the HR-Sync-Prod app, using a client secret. That secret was created last year with a 12-month expiry, and the only person who'd have noticed the reminder had left. At midnight on Sunday it expired, and the nightly sync failed with AADSTS7000222.
How you'd fix it for real
- Find the failing service principal sign-in and note the application ID and error code.
- Open the app registration with that exact application ID; similar names are a trap.
- Add a new client secret and copy its value immediately, because it's only shown once.
- Update the secret in the system that uses it, run it, then delete the expired secret.
Stop it happening again
- Track every secret and certificate's expiry date, with reminders going to a team, not a person.
- Prefer certificates or managed identities to client secrets where the app supports them.
- Don't solve an authentication error by granting more permissions; it adds risk and fixes nothing.