TapAuth provides OAuth tokens and user-approved manual secrets through OpenClaw's exec secrets provider. Values are resolved at gateway startup and held in memory — they never appear in shell commands or config files as plaintext.
You must NEVER use tapauth.sh --token directly in shell commands, curl calls, or $(...) substitutions. Tokens are always resolved through the secrets manager. Your job as an agent is to configure the secrets provider, not to fetch tokens yourself.
Follow these steps in order. Do not skip to step 3. Do not run --token yourself.
Run the script without --token to create a grant. Set TAPAUTH_HOME so the grant cache is stored in a stable location that the exec provider can also find:
TAPAUTH_HOME=/home/node/.tapauth /home/node/.openclaw/skills/tapauth/scripts/tapauth.sh <provider> <scopes>
Example for Google Calendar:
TAPAUTH_HOME=/home/node/.tapauth /home/node/.openclaw/skills/tapauth/scripts/tapauth.sh google calendar.readonly
Example for a manual API key:
TAPAUTH_HOME=/home/node/.tapauth /home/node/.openclaw/skills/tapauth/scripts/tapauth.sh secret "Stripe Secret Key" "^sk_" "Use a Stripe secret key that starts with sk_"
Output:
Approve access: https://tapauth.ai/approve/abc123
Show this URL to the user. Once they approve, run with --token to retrieve the value.
Show the approval URL to the user and ask them to approve. Wait for them to confirm before proceeding.
After the user confirms they approved, edit ~/.openclaw/openclaw.json to add an exec provider under secrets.providers:
{
"secrets": {
"providers": {
"tapauth_google_calendar": {
"source": "exec",
"command": "/home/node/.openclaw/skills/tapauth/scripts/tapauth.sh",
"args": ["--token", "google", "calendar.readonly"],
"passEnv": ["HOME"],
"env": {"TAPAUTH_HOME": "/home/node/.tapauth"},
"jsonOnly": false
}
}
}
}
Key fields:
command: Absolute path to scripts/tapauth.sh in this skill directoryargs: ["--token", "", ""] — must match the grant you created in step 1args for manual secrets: ["--token", "secret", "", "", ""] — description, regex, and hint must match the grant you created in step 1. Use a short, unique, stable, human-readable description because it is part of the lookup key; put formatting instructions in the hint.jsonOnly: false: The script outputs a raw token or secret string, not JSONpassEnv: Must include HOMEenv.TAPAUTH_HOME: Must be /home/node/.tapauth — the same path used when creating the grant in step 1Use the naming convention tapauth_ or tapauth_ for the provider key.
After editing openclaw.json, run:
openclaw secrets reload
This tells the gateway to re-resolve all secret providers. The exec provider runs tapauth.sh --token in the background and stores the result in the in-memory secrets snapshot.
Tell the user the setup is complete. The token is now resolved and will be available at every gateway startup. If the user repeats their request in a new session, the token will already be available.
One-time verification (optional): Since the grant is now approved and cached, you may run the script once to verify and fulfill the user's immediate request:
TAPAUTH_HOME=/home/node/.tapauth /home/node/.openclaw/skills/tapauth/scripts/tapauth.sh --token <provider> <scopes>
After this, all future token access must come from the secrets manager via SecretRef — do not use --token directly again.
tapauth.sh --token directly. Do not use it in $(...), do not capture its output, do not pipe it to curl. The secrets manager runs it for you.command field in the exec provider config.| Provider | Args for exec provider | Scopes Reference |
|---|---|---|
| ---------- | ---------------------- | ------------------ |
| Google Calendar | ["--token", "google", "calendar.readonly"] | references/google.md |
| Google Drive | ["--token", "google", "drive.readonly"] | references/google.md |
| Google Sheets | ["--token", "google", "spreadsheets.readonly"] | references/google.md |
| Gmail | ["--token", "google", "gmail.send"] | references/gmail.md |
| GitHub | ["--token", "github", "repo"] | references/github.md |
| Vercel | ["--token", "vercel", "deployment"] | references/vercel.md |
| Notion | ["--token", "notion", "read_content"] | references/notion.md |
| Slack | ["--token", "slack", "users:read"] | references/slack.md |
| Asana | ["--token", "asana", "tasks:read"] | references/asana.md |
| Linear | ["--token", "linear", "read"] | references/linear.md |
| Sentry | ["--token", "sentry", "project:read"] | references/sentry.md |
| Discord | ["--token", "discord", "identify"] | references/discord.md |
| Apify | ["--token", "apify", "full_api_access"] | references/apify.md |
| Manual Secret | ["--token", "secret", "Stripe Secret Key", "^sk_", "Use a Stripe secret key that starts with sk_"] | Built in |
Multiple scopes: comma-separate in a single string, e.g. ["--token", "google", "calendar.readonly,drive.readonly"].
openclaw secrets reload.tapauth.sh caches tokens locally with expiry. Subsequent calls return instantly if valid.~/.tapauth/-.env and re-run scripts/tapauth.sh to create a new grant.| Symptom | Cause | Fix |
|---|---|---|
| --------- | ------- | ----- |
token refresh failed | Grant revoked or expired | Delete ~/.tapauth/, re-run scripts/tapauth.sh |
| Token works locally but not in OpenClaw | passEnv missing HOME | Add HOME to passEnv array |
command must be absolute path | Relative path in command | Resolve scripts/tapauth.sh to its absolute path |
| Symlink error | Skill installed via symlink | Add allowSymlinkCommand: true and trustedDirs to provider config |
tapauth: timed out | Grant not pre-approved | Run scripts/tapauth.sh without --token first |
共 5 个版本