Warn before the client secret expires (SP_SECRET_EXPIRES)
Azure client secrets lapse silently into opaque 401s (AADSTS7000222). Add a self-reported expiry date (SP_SECRET_EXPIRES=YYYY-MM-DD) and a shared secretExpiryStatus() helper in graph.mjs; surface warnings <30 days out via the CLI (stderr on every command + test output), MCP server startup log, /health, and the sharepoint_test tool. Documented in both .env.examples, setup.md, and READMEs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,9 @@ On the app's **Overview** page, copy:
|
||||
1. App → **Certificates & secrets** → **Client secrets** → **New client secret**.
|
||||
2. Set an expiry (e.g. 6–12 months — note when it expires; you'll have to rotate).
|
||||
3. Copy the secret **Value** immediately (it's only shown once) → `SP_CLIENT_SECRET`.
|
||||
4. Record the expiry date in `.env` as `SP_SECRET_EXPIRES=YYYY-MM-DD` — the CLI
|
||||
and MCP server use it to warn you 30 days ahead instead of failing cold with
|
||||
a 401 (AADSTS7000222) when the secret lapses.
|
||||
|
||||
> Certificates are more secure than secrets for production. This skill uses a
|
||||
> secret for simplicity; swapping to a certificate is a future enhancement.
|
||||
|
||||
Reference in New Issue
Block a user