oauth

Configure OAuth providers for custom TLDs to resolve redirect URI mismatches.

10.4k|338|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/vercel-labs/portless --skill oauth-vercel-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: oauth
Source: https://github.com/vercel-labs/portless/tree/main/skills/oauth
Command: npx skills add https://github.com/vercel-labs/portless --skill oauth-vercel-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill resolves issues with OAuth providers rejecting .localhost subdomains, preventing sign-in flows from working correctly during local development.

Core Features & Use Cases

  • Provider Configuration: Guides you through setting up OAuth for Google, Apple, Microsoft, Facebook, and GitHub with custom TLDs.
  • Error Resolution: Directly addresses "redirect_uri_mismatch" and "invalid redirect" errors.
  • Use Case: You're developing a web app and need to integrate Google Sign-In. When testing locally with portless, you encounter a redirect_uri_mismatch error because Google doesn't recognize myapp.localhost. This Skill helps you configure portless with a valid TLD like .dev to fix the issue.

Quick Start

Configure your OAuth provider to use https://myapp.dev/api/auth/callback/google as the redirect URI.

Frequently Asked Questions about oauth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a redirect_uri_mismatch error during local OAuth sign-in?

Yes, Google rejects `.localhost` subdomains during local development because it does not recognize them as valid redirect URIs. You need to configure portless with a valid TLD like `.dev` and update your Google OAuth redirect URI to `https://myapp.dev/api/auth/callback/google` to resolve the sign-in failure.

Does this OAuth configuration work with Facebook, GitHub, Apple, and Microsoft providers?

To configure OAuth redirect URIs with portless for local development, set up a custom TLD like `.dev` in portless and update your OAuth provider's dashboard with the corresponding redirect URI. You may also need to configure environment variables like `NEXTAUTH_URL` for your specific auth library.

Why does OAuth fail when using `.localhost` domains?

OAuth fails when using `.localhost` domains because OAuth providers reject `.localhost` subdomains, preventing sign-in flows from working correctly. Providers require valid redirect URIs, so you must use a recognized custom TLD like `.dev` provided by portless to bypass this local development limitation.

Do I need to set environment variables for auth libraries when using custom TLDs?

Yes, you need to set environment variables like `NEXTAUTH_URL` for auth libraries when using custom TLDs. Configuring these environment variables ensures your authentication library correctly references the portless custom TLD redirect URI during local development sign-in flows.