mcpField
D
da-auth

da-auth

github.com/adobeSecurity3161.0k installsUpdated today
Repository

About da-auth

A skill for obtaining and validating an Adobe IMS access token for DA Admin API calls. It checks the cached token first, then supports browser-based authentication through a helper CLI, an available DA MCP server, or manual token entry.

Key features

  1. 01Checks cached token validity
  2. 02Obtains tokens through browser login
  3. 03Supports DA MCP authentication
  4. 04Verifies tokens against the DA API

Use cases

  1. 01Authenticate before pushing DA content
  2. 02List documents in a DA repository
  3. 03Start a DA content preview

MCP support

When a DA MCP server is active, the skill directs the caller to use its authentication tool to start OAuth and retrieve the token.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/adobe/skills --skill da-auth

After installing, type/da-authin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

.releaserc.json
CHANGELOG.md
package.json

Details

From the project README

DA Authentication

Gets a valid Adobe IMS access token and stores it in DA_TOKEN for use in subsequent admin.da.live API calls.

When to Use This Skill

Use this skill whenever you need to call the DA Admin API (admin.da.live) and do not already have a valid token in scope. Common cases:

  • Pushing or updating page content in DA
  • Listing documents in a DA repository
  • Triggering a DA content preview

Do NOT use this skill when:

  • You already obtained a DA_TOKEN earlier in the same session and it has not expired (tokens are valid for ~1 hour with a 60-second buffer)
  • The create-site skill is already handling authentication as part of its own flow
  • A DA MCP server is active in the session — use its authentication tool directly instead

Prerequisites

  • Node.js 18+ installed
  • A browser accessible from the machine (for the OAuth flow)
  • Network access to ims-na1.adobelogin.com

Related Skills

  • create-site — includes its own DA auth step for new site onboarding; do not invoke da-auth separately within that flow
  • content-driven-development — use da-auth before pushing authored content to DA
  • building-blocks — use da-auth if test content needs to be pushed to DA for block development
  • snowflake — invoke da-auth before Phase 5 (round-trip) so $DA_TOKEN is set when snowflake PUTs the converted page to DA
  • da-content — the reference for what to do with $DA_TOKEN once you have it (Source API, preview/publish)

Step 1: Check for a Cached Token

Before triggering a browser login, check whether a valid token is already cached.

DA_TOKEN=$(node -e "
  const fs = require('fs');
  const p = process.env.HOME + '/.aem/da-token.json';
  try {
    const t = JSON.parse(fs.readFileSync(p, 'utf8'));
    if (t.expires_at > Date.now() + 60000) process.stdout.write(t.access_token);
  } catch {}
")

If DA_TOKEN is non-empty, skip to Step 3.

Step 2: Obtain a Token (login required)

Choose the option that fits the environment:

Option A (preferred) — da-auth-helper CLI:

The da-auth-helper tool handles the full IMS OAuth 2.0 implicit flow, caches the token at ~/.aem/da-token.json, and prints the token to stdout.

# Run directly without a global install
DA_TOKEN=$(npx github:adobe-rnd/da-auth-helper token)

If npx is unavailable or slow, install globally first:

npm install -g github:adobe-rnd/da-auth-helper
DA_TOKEN=$(da-auth-helper token)

This opens a browser window. Instruct the user:

Please complete the Adobe IMS login in the browser window that just opened. The token will be captured automatically once you log in.

Success: DA_TOKEN is a non-empty JWT string starting with eyJ.

Option B — DA MCP server:

If a DA MCP server is configured in the session, use its authentication tool to start the OAuth flow and retrieve the token from the response.

Option C — Manual paste (last resort):

I need an Adobe IMS access token to push content to DA. You can copy one from your browser:

  1. Open da.live and log in
  2. Open DevTools → Network tab → find any request to admin.da.live
  3. Copy the Authorization: Bearer <token> value (without the Bearer prefix)
  4. Paste it here

Step 3: Verify the Token Works

Confirm the token is accepted by the DA API before proceeding:

curl -s -o /dev/null -w "%{http_code}" \
  -H "Authorization: Bearer {{DA_TOKEN}}" \
  "https://admin.da.live/list/{{ORG}}/{{REPO}}"

Success: HTTP 200. The token is valid — DA_TOKEN is ready for use by the calling skill.

Troubleshooting

SymptomLikely causeFix
DA_TOKEN is empty after Step 1No cached token or token expiredProceed to Step 2
Browser window does not opennpx / da-auth-helper blocked or headless environmentUse Option B (MCP) or Option C (manual paste)
npx github:adobe-rnd/da-auth-helper failsNetwork restrictions on GitHub package registryUse Option B (DA MCP server) or Option C (manual token paste)
Step 3 returns 401Token expired between stepsRe-run Step 2 to refresh
Step 3 returns 403Authenticated user lacks access to {{ORG}}/{{REPO}}Ask the user to verify their DA permissions for that org/repo

Reference

Comments

Markdown supported