# nextauthjs/next-auth

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/nextauthjs-next-auth).**

28,277 stars · 4,041 forks · TypeScript · ISC

## Links

- GitHub: https://github.com/nextauthjs/next-auth
- Homepage: https://authjs.dev
- awesome-repositories: https://awesome-repositories.com/repository/nextauthjs-next-auth.md

## Topics

`auth` `authentication` `csrf` `jwt` `nextauth` `nextjs` `nodejs` `nuxt` `nuxt-auth` `oauth` `oauth2` `oidc` `react` `remix-auth` `solid-auth` `solidjs` `sveltekit` `web`

## Description

Next-auth is an authentication and identity management library for web frameworks. It provides a unified system for handling user sign-in and session state across server and client environments, functioning as a session management framework and an OIDC authentication library.

The project distinguishes itself through a provider-based identity abstraction that supports multiple authentication methods, including OAuth, email magic links, traditional credentials, and passwordless passkeys. It allows for the registration of custom OAuth or OIDC compliant providers and offers tools to define brandable sign-in pages and custom authentication routes.

The library covers a broad surface of identity capabilities, including database persistence via pluggable adapters for user profiles and session storage. It implements request security enforcement through CSRF token validation and route protection via middleware, while maintaining user state using either signed tokens or database-backed sessions.

The system includes observability tools for recording authentication events and errors through logging services.

## Tags

### Security & Cryptography

- [Authentication Frameworks](https://awesome-repositories.com/f/security-cryptography/authentication-frameworks.md) — Provides a comprehensive framework for implementing various authentication strategies and managing user sessions in web applications. ([source](https://authjs.dev/getting-started/integrations))
- [OAuth and Identity Providers](https://awesome-repositories.com/f/security-cryptography/identity-access-management/authentication-strategies/user-facing-login-methods/oauth-identity-providers.md) — Integrates with external OAuth and OIDC identity providers to allow users to sign in with third-party accounts.
- [Credential Authentication](https://awesome-repositories.com/f/security-cryptography/authentication-clients/credential-authentication.md) — Verifies user identities via traditional username and password combinations managed directly by the application. ([source](https://authjs.dev/concepts))
- [Authentication Middleware](https://awesome-repositories.com/f/security-cryptography/authentication-middleware.md) — Implements security middleware to verify identity and enforce access control on incoming requests.
- [External Identity Provider Integration](https://awesome-repositories.com/f/security-cryptography/external-identity-provider-integration.md) — Integrates with external OAuth services, email-based passwordless systems, and directories to authenticate users. ([source](https://cdn.jsdelivr.net/gh/nextauthjs/next-auth@main/README.md))
- [Identity Store Adapters](https://awesome-repositories.com/f/security-cryptography/identity-access-management/credential-lifecycle-management/authentication-management/connection-credentials/stored-credential-retrievals/database-backed-retrieval/identity-store-adapters.md) — Uses a pluggable adapter system to persist user accounts and authentication data into external databases.
- [User Profile Management](https://awesome-repositories.com/f/security-cryptography/identity-access-management/identity-management/user-management/user-profile-management.md) — Provides functionality for storing and managing user account attributes and profiles through pluggable database adapters. ([source](https://authjs.dev/reference/overview))
- [External Database Persistence](https://awesome-repositories.com/f/security-cryptography/identity-access-management/session-management/stateful-session-persistence/external-database-persistence.md) — Persists authentication session data and user profiles in external databases to maintain state across server instances.
- [Cross-Framework Logic](https://awesome-repositories.com/f/security-cryptography/identity-authentication/cross-framework-logic.md) — Ensures uniform identity management and session behavior across various web frameworks and server environments. ([source](https://authjs.dev/reference/overview))
- [Identity Abstractions](https://awesome-repositories.com/f/security-cryptography/identity-providers/identity-abstractions.md) — Standardizes diverse authentication methods like OAuth, Email, and Credentials through a unified configuration object.
- [OAuth 2.0 Authorization Flows](https://awesome-repositories.com/f/security-cryptography/oauth-2-0-authorization-flows.md) — Implements standard OAuth 2.0 authorization flows, including the exchange of authorization codes for access tokens.
- [OAuth Provider Integrations](https://awesome-repositories.com/f/security-cryptography/oauth-authentication/oauth-provider-integrations.md) — Facilitates user sign-in by connecting to external identity providers and mapping third-party accounts. ([source](https://authjs.dev/guides/configuring-github))
- [Session Management Frameworks](https://awesome-repositories.com/f/security-cryptography/session-management-frameworks.md) — Maintains user state using either signed JWT tokens or database-backed sessions across server and client environments.
- [Stateless Session Management](https://awesome-repositories.com/f/security-cryptography/stateless-session-management.md) — Maintains user identity state using signed JWTs stored in encrypted cookies for stateless session operation.
- [User Authentication Flows](https://awesome-repositories.com/f/security-cryptography/user-authentication-flows.md) — Supports diverse identity verification methods including OAuth, email magic links, passwords, and passkeys. ([source](https://authjs.dev/getting-started))
- [Web Application Security](https://awesome-repositories.com/f/security-cryptography/web-application-security.md) — Provides security middleware to protect web applications using CSRF token validation and restrictive cookie policies.
- [Authentication Workflows](https://awesome-repositories.com/f/security-cryptography/authentication-workflows/authentication-workflows.md) — Implements configurable workflows for sign-in, including support for passwords, magic links, and passkeys.
- [Cross-Site Request Forgery Protections](https://awesome-repositories.com/f/security-cryptography/cross-site-request-forgery-protections.md) — Provides cryptographically secure token validation to prevent cross-site request forgery on state-changing authentication requests.
- [Application Request Security](https://awesome-repositories.com/f/security-cryptography/edge-security-enforcements/application-request-security.md) — Protects sensitive routes by enforcing CSRF tokens and applying restrictive cookie policies during login. ([source](https://cdn.jsdelivr.net/gh/nextauthjs/next-auth@main/README.md))
- [Provider Configurations](https://awesome-repositories.com/f/security-cryptography/oauth-authentication/oauth-provider-integrations/provider-configurations.md) — Provides tools for customizing third-party identity provider settings, including scope adjustments and user profile mapping. ([source](https://authjs.dev/guides/configuring-oauth-providers))
- [Third-Party Integrations](https://awesome-repositories.com/f/security-cryptography/third-party-integrations.md) — Connects to third-party identity services using built-in or custom configurations to handle user authentication. ([source](https://authjs.dev))

### Data & Databases

- [Database Adapters](https://awesome-repositories.com/f/data-databases/database-adapters.md) — Implements a pluggable adapter system to decouple authentication data from specific database engines and ORMs.

### Development Tools & Productivity

- [OAuth Provider Registrations](https://awesome-repositories.com/f/development-tools-productivity/dynamic-configuration-providers/dynamic-provider-registration/oauth-provider-registrations.md) — Allows the registration of any OIDC or OAuth compliant identity provider via custom configuration objects. ([source](https://authjs.dev/guides/configuring-oauth-providers))

### Networking & Communication

- [Route Middleware](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/request-processing-architectures/request-processing/route-middleware.md) — Provides middleware to intercept requests and verify session validity before granting access to protected routes.

### Web Development

- [Sign-In Page Customizations](https://awesome-repositories.com/f/web-development/custom-page-frameworks/sign-in-page-customizations.md) — Provides the ability to replace default sign-in pages with custom branded interfaces while maintaining backend integration. ([source](https://authjs.dev))
