npx skills add ...
npx skills add adobe/skills --skill auth
Authenticate with AEM Edge Delivery Services. Opens browser for login and captures token. Works for admin.hlx.page and Config Service APIs regardless of content source (Document Authoring, SharePoint, or Google Drive).
npx skills add adobe/skills --skill auth
Authenticate to obtain a token for all Edge Delivery Services admin operations. Auto-detects identity provider from org+site — no content source question needed. Opens the user's default browser for login and receives the token via a local callback server.
The authToken works for admin APIs:
| API | Header | Usage |
|---|---|---|
admin.hlx.page | x-auth-token: ${AUTH_TOKEN} | Preview, publish, status, code sync, jobs, logs, config |
| Config Service | x-auth-token: ${AUTH_TOKEN} | Sites, config, secrets, API keys, profiles |
Note:
admin.da.liveuses a separate Adobe IMS token withAuthorization: Bearerheader. See the DA-specific login flow inops/resources/da.md.
Tokens are cached at the user level (~/.aem/ims-token.json), shared across all projects.
The auto-login endpoint /login/{org}/{site}/main redirects to the correct identity provider automatically — no need to know the content source.
Resolve org and site from available sources (project-config, ops-config, git remote):
If ORG is empty, ask the user:
"I need your organization name to authenticate. You can provide either:
- The org name (the
{org}inhttps://main--site--{org}.aem.page)- A preview/live URL like
https://main--mysite--myorg.aem.page/"
If user provides a URL, parse org and site from it:
If SITE is still empty (not in a git repo and no URL provided), ask the user:
"I also need a site name to auto-detect your login provider. What is your site name? (the
{site}part ofhttps://main--{site}--{org}.aem.page)"
Do NOT proceed until both org and site are available.
Opens the user's default browser for login. A temporary local HTTP server receives the token callback after login completes. The user must click "Send" on the confirmation page to deliver the token. Works with all identity providers (Adobe IMS, Google, Microsoft).
User-facing message (display BEFORE running the script below):
Browser opened for login to
{org}/{site}. Click "Send" after authenticating — you can close the tab once done.
Use bold/highlighted formatting so the instruction stands out clearly.
User-level token cache — ~/.aem/ims-token.json:
| Field | Description |
|---|---|
authToken | Admin JWT from login callback |
authTokenExpiry | Unix timestamp when token expires (~24 hours) |
Shared across every project on this machine. File is written with 0600 permissions.
| Issue | Solution |
|---|---|
| Browser doesn't open | Manually open the URL printed in the terminal |
| "Send" button not working | Check browser console for errors; ensure no ad-blocker is blocking localhost requests |
| No authToken in callback | The helix-admin PR adding authToken to CLI login response has not yet been deployed |
| Token not received | Ensure you clicked "Send" on the confirmation page before the 5-minute timeout |
| 401 after login | Token expired, re-authenticate |
| 403 on API | User lacks permission for that org/site |
| State mismatch | Another process may have sent a rogue callback; re-run login |
admin.hlx.page/login/{org}/{site}/main with client_id=aem-cli and redirect_uri=http://localhost:{port}/...{ state, authToken } to localhostauthToken to ~/.aem/ims-token.json, exitsCalled by: ops, handover-admin, handover-author, handover-developer, handover