One-click install
npx skills add https://github.com/andreasasprou/polaris --skill oauth-andreasasprou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: oauth
Source: https://github.com/andreasasprou/polaris/tree/main/.agents/skills/oauth
Command: npx skills add https://github.com/andreasasprou/polaris --skill oauth-andreasasprou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Local OAuth flows often fail because providers reject .localhost subdomains or require publicly valid redirect URIs, causing errors like redirect_uri_mismatch or invalid redirect; this Skill explains how to use portless with a real TLD and correct environment/provider settings so callbacks succeed during local development.

Core Features & Use Cases

  • Provider compatibility: Steps for Google, Apple, Microsoft (Azure AD), Facebook, and GitHub to register portless-based redirect URIs.
  • Portless configuration: Guidance on choosing a public-suffix TLD, running a trusted local proxy with HTTPS, and avoiding .localhost pitfalls.
  • Env and library fixes: Concrete checks and environment variables to update (NEXTAUTH_URL, PORTLESS_URL, callbackURL) and troubleshooting for HSTS and Apple-specific public resolution requirements.
  • Use case: Enable sign-in flows for a Next.js app using NextAuth during local development without provider rejections.

Quick Start

Start a portless proxy with a valid public TLD and update your application's callback URLs and NEXTAUTH_URL to match the resulting https://myapp.dev so the registered provider redirect URIs align.

Frequently Asked Questions about oauth

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

FAQPage Schema
Why does OAuth redirect_uri_mismatch happen with .localhost during local development?

OAuth redirect_uri_mismatch happens because providers reject .localhost subdomains lacking a valid public-suffix TLD. You must use a local proxy like portless with a real TLD and HTTPS so your redirect URIs align with registered provider entries.

How do I configure Google and Apple OAuth redirect URIs for local development?

To configure Google and Apple OAuth redirect URIs, update your provider console entries to match a portless proxy URL like https://myapp.dev. Apple specifically requires public domain resolution, so ensure your local environment serves the callback over a valid public-suffix TLD.

Does NextAuth work with portless for local OAuth testing?

Yes, NextAuth works with portless by updating your NEXTAUTH_URL environment variable to match your portless https://myapp.dev proxy address. This ensures your sign-in flows resolve correctly without provider rejections during local testing.

What environment variables do I need to fix OAuth redirect errors in Next.js?

Fixing OAuth redirect errors requires updating environment variables like NEXTAUTH_URL, PORTLESS_URL, and callbackURL to match your portless proxy address. These variables ensure your application generates redirect URLs that align with your registered provider entries.

Do I need HTTPS for local OAuth callbacks using a custom TLD?

Yes, you need HTTPS for local OAuth callbacks when using a custom TLD because HSTS-enforced domains require secure connections. Running a trusted local proxy like portless with HTTPS ensures providers accept your redirect URIs without rejection.