New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Configuration guide for OAuth providers to accept portless local dev URLs on valid TLDs.

skills.sh installs
3.1K
GitHub stars
12.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers provider setup for Google, Apple, Microsoft, Facebook, and GitHub, including the redirect URIs and origins to register
  • Explains why .localhost subdomains fail on strict providers and how --tld with a Public Suffix List domain fixes it
  • Includes auth library settings for NextAuth/Auth.js, Passport.js, and a generic PORTLESS_URL pattern
  • Designed for developers hitting redirect_uri_mismatch or sign-in failures when running apps locally under portless

Install

$ npx -y skills add vercel-labs/portless --skill oauth -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

OAuth with Portless

OAuth providers validate redirect URIs against domain rules. .localhost subdomains fail on most providers because they are not in the Public Suffix List or are explicitly blocked. Portless fixes this with --tld to serve apps on real, valid domains.

The Problem

When portless uses the default .localhost TLD, OAuth providers reject redirect URIs like http://myapp.localhost:1355/callback:

Providerlocalhost.localhost subdomainsReason
GoogleAllowedRejectedNot in their bundled PSL
AppleRejectedRejectedNo localhost at all
MicrosoftAllowedAllowedPermissive localhost handling
FacebookAllowedVariesMust register each URI exactly
GitHubAllowedAllowedPermissive

Google and Apple are the strictest. Microsoft and GitHub are more lenient with localhost.

The Fix

Details

Repository
github.com/vercel-labs/portless
Categories
Backend & APIs, Technical Documentation, DevOps & Cloud
First seen
May 16, 2026

More from vercel-labs/portless

All 2

Similar to Oauth

More Backend & APIs