Skip to content

Conversation

@omar-inkeep
Copy link
Contributor

Summary

Adds OAuth 2.1 server capabilities to enable Nango to act as an OAuth client for token management.

Changes

New Endpoints

  • /.well-known/oauth-authorization-server - OAuth discovery metadata
  • /.well-known/openid-configuration - OpenID Connect discovery
  • /login - OAuth login redirect (forwards to manage-ui with returnUrl)
  • /manage/api/oauth-clients - CRUD for OAuth clients

Fixes

  • Fixed Better Auth version alignment (all packages to ~1.4.17)
  • Fixed baseURL in auth.ts (was incorrectly using DB URL)
  • Fixed runtime-config import in consent page
  • Added PORT env var support for Vite dev server

Database

  • Added migration for OAuth-related tables

Testing

  1. Register OAuth client:
curl -X POST 'http://localhost:3002/manage/api/oauth-clients' \
  -H 'Content-Type: application/json' \
  -b 'better-auth.session_token=<token>' \
  -d '{
    "name": "Nango Integration",
    "redirectUris": ["https://api.nango.dev/oauth/callback"],
    "skipConsent": true
  }'
  1. Configure Nango with client_id/secret
  2. Test OAuth flow through Nango

- Add well-known OAuth discovery endpoints (/.well-known/oauth-authorization-server)
- Add login redirect route for OAuth flow
- Add OAuth clients API for registering OAuth clients
- Mount oauth-clients routes at /manage/api/oauth-clients
- Fix Better Auth version alignment (all packages to ~1.4.17)
- Fix baseURL config in auth.ts (was using DB URL instead of API URL)
- Fix runtime-config import in consent page
- Add PORT env var support for Vite dev server
- Add database migration for OAuth tables
@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

⚠️ No Changeset found

Latest commit: 33dd57a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
agents-api Ready Ready Preview, Comment Jan 29, 2026 0:14am
agents-docs Ready Ready Preview, Comment Jan 29, 2026 0:14am
agents-manage-ui Error Error Jan 29, 2026 0:14am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants