Skip to content

docs: add Authentication API migration guide (auth0-auth-js / auth0-server-js) - #1395

Open
tusharpandey13 wants to merge 2 commits into
masterfrom
docs/auth-migration-guide
Open

docs: add Authentication API migration guide (auth0-auth-js / auth0-server-js)#1395
tusharpandey13 wants to merge 2 commits into
masterfrom
docs/auth-migration-guide

Conversation

@tusharpandey13

@tusharpandey13 tusharpandey13 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds AUTH_MIGRATION_GUIDE.md, an end-user guide for migrating the Authentication API layer off the auth0 package (AuthenticationClient, UserInfoClient) to the current first-party server SDKs:

  • @auth0/auth0-auth-js for stateless token grants (the direct successor to AuthenticationClient)
  • @auth0/auth0-server-js for server-managed sessions (redirect login, cookies, refresh, logout)

The Management API (ManagementClient) is explicitly out of scope and stays on auth0. The guide is written to sit alongside the existing v5/v6 migration guides and matches their conventions.

What the guide covers

  • Overview, audience, and in/out-of-scope boundaries.
  • Target-SDK decision table with a default recommendation and routing signals.
  • Prerequisites: Node 20 LTS+, SDK >= 1.12.1, and the accurate RequestOptions / fullResponse post-1.12.1 caveat.
  • Installation plus constructor/option mapping for both AuthClient and ServerClient.
  • Complete method-by-method API mapping for .oauth, .database, .passwordless, .backchannel, .tokenExchange, and UserInfoClient, with before/after code and a quick lookup table.
  • The four cross-cutting breaking changes: return shape, casing, the silent expires_inexpiresAt expiry bug, and the typed error model with isMfaRequiredError().
  • The server-js session lifecycle (startInteractiveLogincompleteInteractiveLogingetUser/getAccessTokenlogout), store setup, and non-redirect session logins.
  • A build-until-green verification checklist and an FAQ/gotchas section.

Also links the new guide from the README documentation list.

🤖 Generated with Claude Code

Related PRs

…-server-js

Add AUTH_MIGRATION_GUIDE.md covering the surgical migration of the
Authentication layer off the auth0 package (AuthenticationClient,
UserInfoClient) to @auth0/auth0-auth-js (stateless token grants) and
@auth0/auth0-server-js (server-managed sessions). ManagementClient is
out of scope and stays on auth0.

Link the new guide from the README documentation list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tusharpandey13
tusharpandey13 requested a review from a team as a code owner August 26, 2026 15:07
@tusharpandey13
tusharpandey13 changed the base branch from master to feat/auth-separation-v6 August 26, 2026 17:11
@tusharpandey13

Copy link
Copy Markdown
Contributor Author

Source-verified every API claim against auth0-auth-js and auth0-server-js.
Fix the mismatches found:

- fullResponse: remove the fabricated "token cache is bypassed" behavior.
  auth0-auth-js AuthClient has no token cache; grant methods always hit the
  endpoint. Token caching lives in auth0-server-js. Only discovery/JWKS is cached.
- getTokenByCode: options are codeVerifier and organization; there is no
  expectedState parameter (that is on getTokenByMagicLinkCode). Corrected the
  code comment and the state-handling note.
- initiateBackchannelAuthentication: scope goes via authorizationParams.scope,
  not a top-level key; loginHint is an object ({ sub }), not a bare string.
- server-js re-exports: it DOES re-export ApiResponse and FullResponseOption
  (alongside RequestOptions), not just RequestOptions.
- Custom store base class is AbstractStateStore (the exported name), not
  AbstractSessionStore.
- serverClient.revokeRefreshToken also accepts an explicit { token }; noted it
  defaults to the session refresh token.
- mfa.* list now includes deleteAuthenticator.
- changePassword accepts email OR username (plus connection), not email alone.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tusharpandey13
tusharpandey13 force-pushed the docs/auth-migration-guide branch from 98aeddc to a2ef5c8 Compare August 27, 2026 12:18
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.73%. Comparing base (f9d6413) to head (a2ef5c8).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #1395    +/-   ##
========================================
  Coverage   89.73%   89.73%            
========================================
  Files         441      441            
  Lines       20799    20799            
  Branches    10146     9809   -337     
========================================
  Hits        18663    18663            
  Misses       2136     2136            
Flag Coverage Δ
alltests 89.73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant