From project-management
Opens browser via Playwright for Adobe ID login to authenticate with AEM Edge Delivery Services Config Service API and captures auth token. Use before generating API-requiring guides or on 401 errors.
npx claudepluginhub adobe/skillsThis skill is limited to using the following tools:
This skill handles browser-based authentication for AEM Edge Delivery Services Config Service API using Playwright CLI. It opens a browser window for Adobe ID login and captures the auth token when the browser is closed.
Generates admin guide for AEM Edge Delivery Services projects, covering Config Service setup, permissions, access control, Admin API operations, cache management, and code sync. For handovers.
Installs and configures Adobe OAuth Server-to-Server credentials; sets up SDKs for Firefly Services, PDF Services, I/O Runtime in Node.js or Python.
Provides Python patterns for external service authentication using API keys, OAuth, tokens. Includes verification flows, smoke tests, env checks, and error handling with leyline.
Share bugs, ideas, or general feedback.
This skill handles browser-based authentication for AEM Edge Delivery Services Config Service API using Playwright CLI. It opens a browser window for Adobe ID login and captures the auth token when the browser is closed.
.claude-plugin/project-config.json or user input)# Read saved org name
ORG=$(cat .claude-plugin/project-config.json 2>/dev/null | grep -o '"org"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"org"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')
If org is not saved, prompt user:
"What is your Config Service organization name? (the
{org}inhttps://main--site--{org}.aem.page)"
Save the org name:
mkdir -p .claude-plugin
# Ensure .claude-plugin is in .gitignore (contains auth tokens)
grep -qxF '.claude-plugin/' .gitignore 2>/dev/null || echo '.claude-plugin/' >> .gitignore
echo "{\"org\": \"${ORG}\"}" > .claude-plugin/project-config.json
Then fetch the first site name from Config Service (unauthenticated endpoint):
SITE=$(curl -s "https://admin.hlx.page/config/${ORG}/sites.json" | grep -o '"name"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | sed 's/"name"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')
npx playwright --version 2>/dev/null || npm install -g playwright
npx playwright install chromium 2>/dev/null || true
IMPORTANT: Print highly visible instructions BEFORE opening the browser:
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ BROWSER WINDOW OPENING FOR ADOBE ID LOGIN ║"
echo "║ ║"
echo "║ 1. Sign in with your Adobe ID credentials ║"
echo "║ 2. After successful login, CLOSE THE BROWSER WINDOW ║"
echo "║ ║"
echo "║ >>> CLOSE THE BROWSER TO CONTINUE <<< ║"
echo "║ ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
Then open the browser with storage save:
mkdir -p .claude-plugin
npx playwright open --save-storage=.claude-plugin/auth-storage.json "https://admin.hlx.page/login/${ORG}/${SITE}/main"
Note: This command blocks until the browser is closed. The auth token is saved to auth-storage.json when the browser closes.
After browser is closed, extract the token:
echo ""
echo "Browser closed. Extracting auth token..."
AUTH_TOKEN=$(node -e "
const fs = require('fs');
try {
const data = JSON.parse(fs.readFileSync('.claude-plugin/auth-storage.json', 'utf8'));
const cookie = data.cookies.find(c => c.name === 'auth_token');
if (cookie) {
console.log(cookie.value);
} else {
console.error('ERROR: auth_token cookie not found. Login may have failed.');
process.exit(1);
}
} catch (e) {
console.error('ERROR: Could not read auth storage file.');
process.exit(1);
}
")
ORG=$(cat .claude-plugin/project-config.json | grep -o '"org"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"org"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')
echo "{\"org\": \"${ORG}\", \"authToken\": \"${AUTH_TOKEN}\"}" > .claude-plugin/project-config.json
# Clean up storage file (contains sensitive session data)
rm -f .claude-plugin/auth-storage.json
echo "Auth token saved successfully."
AUTH_TOKEN=$(cat .claude-plugin/project-config.json | grep -o '"authToken"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"authToken"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')
ORG=$(cat .claude-plugin/project-config.json | grep -o '"org"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"org"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')
HTTP_CODE=$(curl -s -w "%{http_code}" -o /dev/null -H "x-auth-token: ${AUTH_TOKEN}" \
"https://admin.hlx.page/config/${ORG}/sites.json")
if [ "$HTTP_CODE" = "200" ]; then
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ ✓ AUTHENTICATION SUCCESSFUL ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
else
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ ✗ AUTHENTICATION FAILED (HTTP $HTTP_CODE) ║"
echo "║ Please try again ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
fi
Auth tokens are stored in .claude-plugin/project-config.json:
{
"org": "myorg",
"authToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Security Note: Add .claude-plugin/ to .gitignore.
AUTH_TOKEN=$(cat .claude-plugin/project-config.json 2>/dev/null | grep -o '"authToken"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"authToken"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')
curl -H "x-auth-token: ${AUTH_TOKEN}" \
"https://admin.hlx.page/config/${ORG}/sites/{site}/access.json"
| Issue | Solution |
|---|---|
npx playwright not found | Run npm install -g playwright |
| Browser doesn't open | Run npx playwright install chromium |
| Token not found after login | Ensure login completed before closing browser |
| Login page not loading | Verify org/site names are correct |
| API returns 401 | Token expired, re-authenticate |
Called by: admin, authoring, development, handover
Invocation:
Skill({ skill: "project-management:auth" })