tailscale-oauth-bridge
Skill2 starsChanged 7 months agoMITView on GitHub
Use Tailscale + SSH local forwarding to handle OAuth loopback callback (localhost) from PC to Android phone when authenticating Codex/cli-proxy-api.
In this repository47 other files it gives its agents.
- brainstormingSkill
- claude-code-termux-runbookSkill
- cli-patcherSkill
- code-review-workflowSkill
- commit-commandsSkill
- consulting-analysisSkill
- context7-cleanSkill
- data-analysisSkill
- deep-researchSkill
- edit-tool-compat-guardSkill
- env-managerSkill
- executing-plansSkill
- feature-devSkill
- firecrawlSkill
- frontend-designSkill
- gateway-device-pairingSkill
- githubSkill
- glibc-prebuilt-bundleSkill
- gogSkill
- image-generationSkill
- memory-setupSkill
- module-auditorSkill
- module-scaffoldSkill
- openclaw-config-guardianSkill
- openclaw-ollama-runtime-kbSkill
- plugin-cutover-guardianSkill
- plugin-runtime-guardianSkill
- python-env-managerSkill
- self-improving-agentSkill
- simplify-and-hardenSkill
- skill-benchSkill
- skill-creatorSkill
- skill-unificationSkill
- skill-vetterSkill
- socratic-groundingSkill
- subagent-orchestrationSkill
- systematic-debuggingSkill
- termux-packagerSkill
- termux-runnerSkill
- test-driven-developmentSkill
- vercel-deploy-claimableSkill
- verification-before-completionSkill
- video-generationSkill
- workspace-cleanupSkill
- writing-plansSkill
- yt-dlp-ingest-firstSkill
- zero-downtime-cutoverSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Check results, state validation, and next steps.
- Distinctive: line 38
Do not expose ports to the Internet.
- Distinctive: line 66
Keep the SSH tunnel alive during the entire auth process.
- Very specific: line 72
If there is a 302 to http://127.0.0.1:8317/codex/callback, browser can still follow because of tunnel 8317.
- Very specific: line 73
Verify after each account: call http://127.0.0.1:8317/v1/models and check auth success logs.
- Very specific: line 79
Use -p 8022 and ensure sshd is running.
- Distinctive: line 91
Use SSH key when stable, avoid long-term password auth.
- Distinctive: line 93
Do not use Funnel/public expose for this flow.
- Distinctive: line 101
If loopback callback still cannot reach PC: verify correct local forward/port map before suspecting OAuth provider.
- Distinctive: line 102
If Tailscale IP/route cannot reach phone: split triage into tailnet connectivity and SSH tunnel instead of debugging the whole stack at …
- Distinctive: line 103
If auth flow is complete: remind to close tunnel and clear temporary session to reduce exposure.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tailscale OAuth Bridge
Standardize the multi-account auth flow on PC for services running on phone, when redirect_uri is hard-locked as loopback (for example http://localhost:1455/auth/callback).
Scope
- In-scope: use Tailscale + SSH local forwarding to handle OAuth loopback callback from PC to Android phone.
- Out-of-scope: general network tunneling outside the OAuth callback bridge problem.
SOP
- Determine whether the request is within the skill scope.
- Execute the skill's main workflow/instructions in safe order.
- Check results, state validation, and next steps.
Indexed sub-skill references (source map)
- @[SKILL.md#L1-L95] Standard frontmatter (
name,description). - @[SKILL.md#L6-L95] Tailscale OAuth Bridge.
- @[SKILL.md#L10-L95] When to use.
- @[SKILL.md#L15-L95] Goals.
- @[SKILL.md#L20-L95] Preconditions.
- @[SKILL.md#L27-L95] Standard commands.
- @[SKILL.md#L48-L95] Standard auth process.
- @[SKILL.md#L55-L95] Quick troubleshooting.
- @[SKILL.md#L69-L95] Hardening.
When to use
- OAuth URL has
redirect_uri=http://localhost:<port>/.... - Service actually runs on phone (Android), but login is needed from browser on PC.
- Cannot switch to a custom domain due to
invalid_redirect_uri/hard whitelist.
Goals
- Browser on PC can still log in normally.
localhostcallback on PC is safely forwarded to phone via tailnet.- Do not expose ports to the Internet.
Preconditions
- PC and phone are both logged into the same Tailscale tailnet.
- Phone has an SSH server (Termux
sshdon port8022is recommended). - Service on phone is handling the callback flow:
- callback listener:
127.0.0.1:1455 - codex callback/backend:
127.0.0.1:8317
- callback listener:
Standard commands
On phone (Termux)
pkg update -y && pkg install -y openssh
passwd
sshd
whoamiOn PC
tailscale status
ssh -p 8022 -N \
-L 1455:127.0.0.1:1455 \
-L 8317:127.0.0.1:8317 \
<TERMUX_USER>@<PHONE_TAILSCALE_IP>Keep the SSH tunnel alive during the entire auth process.
Standard auth process
- Initialize auth flow on phone to generate OAuth URL.
- Copy URL to PC, open in browser/Google profile that needs adding account.
- OpenAI redirects to
localhost:1455(PC) -> tunnel forwards to phone. - If there is a 302 to
http://127.0.0.1:8317/codex/callback, browser can still follow because of tunnel 8317. - Verify after each account: call
http://127.0.0.1:8317/v1/modelsand check auth success logs.
Quick troubleshooting
ssh: connect ... port 22: Connection refused
- Phone doesn't have SSH server on 22 yet (normal with Termux).
- Use
-p 8022and ensuresshdis running.
Browser shows 127.0.0.1 refused
- Callback listener on phone is not open at test time.
- Initialize auth flow first, then open URL.
302 -> 127.0.0.1:8317 but fails
- Missing port 8317 forwarding on PC.
- Add
-L 8317:127.0.0.1:8317.
Hardening
- Allow only Boss's PC device in tailnet ACL.
- Use SSH key when stable, avoid long-term password auth.
- End auth session: close tunnel immediately.
- Do not use Funnel/public expose for this flow.
Trigger Rules
- Positive: Activate when user request matches
tailscale-oauth-bridgeby description: Use Tailscale + SSH local forwarding to handle OAuth loopback callback (localhost) from PC to Android phone when authenticating Codex/cli-proxy-api. - Negative: Do not activate for out-of-scope requests or when this skill's workflow/expertise is not needed.
- Escalation: If there is external action/network write or sensitive operations, add an approval checkpoint before execution.
Error Handling
- If loopback callback still cannot reach PC: verify correct local forward/port map before suspecting OAuth provider.
- If Tailscale IP/route cannot reach phone: split triage into tailnet connectivity and SSH tunnel instead of debugging the whole stack at once.
- If auth flow is complete: remind to close tunnel and clear temporary session to reduce exposure.
Output Contract
- Deliverable: result aligned with
tailscale-oauth-bridgeobjective; clearly state artifact/path/steps performed (if any). - Validation: report
PASS/FAILstatus with key checks run. - Failure mode: when failing, state root cause + proposed remediation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

