Adds OAuth2 authentication to a Payload v3 auth collection, working with generic OAuth2 providers. Login starts from a browser navigation to an authorize endpoint on the collection's API route. It has no runtime dependencies and is configured through the plugin options. Google and Zitadel are tested, and an Apple config example is included.
OAuth2 plugin for Payload CMS
Installation
npm i payload-oauth2200
Stars
21
Forks
8
Open Issues
6 months ago
Last Updated
12.1k
Weekly Downloads
v1.0.21
npm Version
72.9 KB
Unpacked Size
0
Dependencies
200+3 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 200 |
| Dec 5, 2026 | 199 |
| Dec 4, 2026 | 199 |
| Dec 3, 2026 | 199 |
| Dec 2, 2026 | 199 |
| Dec 1, 2026 | 198 |
| Nov 30, 2026 | 198 |
| Nov 29, 2026 | 198 |
| Nov 28, 2026 | 198 |
| Nov 27, 2026 | 198 |
| Nov 26, 2026 | 198 |
| Nov 25, 2026 | 198 |
| Nov 24, 2026 | 198 |
| Nov 23, 2026 | 198 |
| Nov 22, 2026 | 198 |
| Nov 21, 2026 | 198 |
| Nov 20, 2026 | 198 |
| Nov 19, 2026 | 198 |
| Nov 18, 2026 | 198 |
| Nov 17, 2026 | 198 |
| Nov 16, 2026 | 198 |
| Nov 15, 2026 | 198 |
| Nov 14, 2026 | 198 |
| Nov 13, 2026 | 198 |
| Nov 12, 2026 | 198 |
| Nov 11, 2026 | 198 |
| Nov 10, 2026 | 198 |
| Nov 9, 2026 | 198 |
| Nov 8, 2026 | 198 |
| Nov 7, 2026 | 198 |
| Nov 6, 2026 | 198 |
| Nov 5, 2026 | 198 |
| Nov 4, 2026 | 198 |
| Nov 3, 2026 | 198 |
| Nov 2, 2026 | 198 |
| Nov 1, 2026 | 198 |
| Oct 31, 2026 | 198 |
| Oct 30, 2026 | 198 |
| Oct 29, 2026 | 198 |
| Oct 28, 2026 | 198 |
| Oct 27, 2026 | 198 |
| Oct 26, 2026 | 198 |
| Oct 25, 2026 | 198 |
| Oct 24, 2026 | 198 |
| Oct 23, 2026 | 198 |
| Oct 22, 2026 | 198 |
| Oct 21, 2026 | 198 |
| Oct 20, 2026 | 198 |
| Oct 19, 2026 | 198 |
| Oct 18, 2026 | 198 |
| Oct 17, 2026 | 198 |
| Oct 16, 2026 | 198 |
| Oct 15, 2026 | 198 |
| Oct 14, 2026 | 198 |
| Oct 13, 2026 | 198 |
| Oct 12, 2026 | 198 |
| Oct 11, 2026 | 198 |
| Oct 10, 2026 | 198 |
| Oct 9, 2026 | 198 |
| Oct 8, 2026 | 198 |
| Oct 7, 2026 | 198 |
| Oct 6, 2026 | 198 |
| Oct 5, 2026 | 198 |
| Oct 4, 2026 | 198 |
| Oct 3, 2026 | 198 |
| Oct 2, 2026 | 198 |
| Oct 1, 2026 | 198 |
| Sep 30, 2026 | 197 |
| Sep 29, 2026 | 197 |
| Sep 28, 2026 | 197 |
| Sep 27, 2026 | 197 |
| Sep 26, 2026 | 197 |
| Sep 25, 2026 | 197 |
| Sep 24, 2026 | 197 |
| Sep 23, 2026 | 197 |
| Sep 22, 2026 | 197 |
| Sep 21, 2026 | 197 |
| Sep 20, 2026 | 197 |
| Sep 19, 2026 | 197 |
| Sep 18, 2026 | 197 |
| Sep 17, 2026 | 197 |
| Sep 16, 2026 | 197 |
| Sep 15, 2026 | 197 |
| Sep 14, 2026 | 197 |
| Sep 13, 2026 | 197 |
| Sep 12, 2026 | 197 |
| Sep 11, 2026 | 197 |
| Sep 10, 2026 | 197 |
| Sep 9, 2026 | 197 |
| Sep 8, 2026 | 197 |
| Sep 7, 2026 | 197 |
12.1K−456 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 12,089 |
| Dec 5, 2026 | 11,895 |
| Dec 4, 2026 | 11,972 |
| Dec 3, 2026 | 11,612 |
| Dec 2, 2026 | 11,717 |
| Dec 1, 2026 | 12,089 |
| Nov 30, 2026 | 12,006 |
| Nov 29, 2026 | 13,046 |
| Nov 28, 2026 | 13,437 |
| Nov 27, 2026 | 13,767 |
| Nov 26, 2026 | 14,517 |
| Nov 25, 2026 | 15,470 |
| Nov 24, 2026 | 16,191 |
| Nov 23, 2026 | 17,273 |
| Nov 22, 2026 | 17,262 |
| Nov 21, 2026 | 18,754 |
| Nov 20, 2026 | 19,860 |
| Nov 19, 2026 | 22,196 |
| Nov 18, 2026 | 23,773 |
| Nov 17, 2026 | 23,659 |
| Nov 16, 2026 | 23,394 |
| Nov 15, 2026 | 25,334 |
| Nov 14, 2026 | 26,827 |
| Nov 13, 2026 | 30,145 |
| Nov 12, 2026 | 30,155 |
| Nov 11, 2026 | 31,051 |
| Nov 10, 2026 | 30,569 |
| Nov 9, 2026 | 30,485 |
| Nov 8, 2026 | 29,421 |
| Nov 7, 2026 | 26,850 |
| Nov 6, 2026 | 23,136 |
| Nov 5, 2026 | 21,572 |
| Nov 4, 2026 | 21,351 |
| Nov 3, 2026 | 21,706 |
| Nov 2, 2026 | 21,426 |
| Nov 1, 2026 | 21,214 |
| Oct 31, 2026 | 22,303 |
| Oct 30, 2026 | 23,059 |
| Oct 29, 2026 | 19,661 |
| Oct 28, 2026 | 14,115 |
| Oct 27, 2026 | 13,914 |
| Oct 26, 2026 | 13,764 |
| Oct 25, 2026 | 14,181 |
| Oct 24, 2026 | 14,517 |
| Oct 23, 2026 | 10,455 |
| Oct 22, 2026 | 14,024 |
| Oct 21, 2026 | 17,144 |
| Oct 20, 2026 | 17,207 |
| Oct 19, 2026 | 16,981 |
| Oct 18, 2026 | 15,839 |
| Oct 17, 2026 | 14,476 |
| Oct 16, 2026 | 16,947 |
| Oct 15, 2026 | 16,657 |
| Oct 14, 2026 | 15,633 |
| Oct 13, 2026 | 15,002 |
| Oct 12, 2026 | 14,842 |
| Oct 11, 2026 | 14,802 |
| Oct 10, 2026 | 15,377 |
| Oct 9, 2026 | 15,684 |
| Oct 8, 2026 | 15,048 |
| Oct 7, 2026 | 15,737 |
| Oct 6, 2026 | 15,717 |
| Oct 5, 2026 | 15,553 |
| Oct 4, 2026 | 15,717 |
| Oct 3, 2026 | 15,612 |
| Oct 2, 2026 | 16,536 |
| Oct 1, 2026 | 16,753 |
| Sep 30, 2026 | 17,686 |
| Sep 29, 2026 | 17,921 |
| Sep 28, 2026 | 18,585 |
| Sep 27, 2026 | 19,588 |
| Sep 26, 2026 | 19,914 |
| Sep 25, 2026 | 19,815 |
| Sep 24, 2026 | 22,231 |
| Sep 23, 2026 | 21,823 |
| Sep 22, 2026 | 21,539 |
| Sep 21, 2026 | 20,775 |
| Sep 20, 2026 | 20,159 |
| Sep 19, 2026 | 20,445 |
| Sep 18, 2026 | 20,736 |
| Sep 17, 2026 | 18,517 |
| Sep 16, 2026 | 17,675 |
| Sep 15, 2026 | 17,860 |
| Sep 14, 2026 | 18,129 |
| Sep 13, 2026 | 17,370 |
| Sep 12, 2026 | 15,750 |
| Sep 11, 2026 | 14,446 |
| Sep 10, 2026 | 13,421 |
| Sep 9, 2026 | 13,010 |
| Sep 8, 2026 | 12,657 |
| Sep 7, 2026 | 12,545 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/793272573-root)<a href="https://payloaddirectory.dev/plugins/793272573-root"><img src="https://payloaddirectory.dev/badge/793272573-root.svg" alt="Payload Directory"></a>README
Technically this plugin should work with all generic OAuth2 providers. Here are the list of providers that have been tested:
| Provider | Status | Example |
|---|---|---|
| Config | ||
| Zitadel | Config | |
| Apple | Test not implemented | Config |
npm install payload-oauth2
yarn install payload-oauth2
pnpm install payload-oauth2
If you are feeling adventurous and want to manage the plugin yourself, you can copy the src directory into your payload projects.
Create a normal browser navigation to the Payload authorize endpoint from your login UI:
export function GoogleLoginButton() {
return <a href="/api/users/oauth/google">Continue with Google</a>
}
In Next.js App Router apps, prefer not to start OAuth with next/link or router.push() for the authorize endpoint. The endpoint returns a redirect to the OAuth provider, not a React Server Component payload. The plugin defensively ignores Next.js RSC navigation probes so client routing can fall back without the noisy Failed to fetch RSC payload ... Falling back to browser navigation log, but normal document navigation is still the most direct option.
Contributions and feedback are very welcome.
To get it running:
pnpm installpnpm devThe MIT License (MIT). Please see License File for more information.
This package was inspired by Payload Plugin OAuth.
Topics
payload authjs
Sign in to Payload CMS through Auth.js 5 providers and use the Auth.js session as the Payload user
903.1k/wk206v3
payload simple social login
Google and Microsoft social login for the Payload admin panel and auth collections
7119/wk3v3
payload auth plugin
Authentication plugin adding OAuth, OIDC, SSO and passkey sign-in to Payload CMS
594.7k/wk310v3
payload better auth
Replace Payload's built-in auth with Better Auth, including admin email OTP and session-based req.user
301v3
payload better auth
Better Auth database adapter and plugins that run authentication through Payload collections
9011.9k/wk77v3 v4
payload zitadel plugin
Log in to the Mzinga admin through Zitadel or another OIDC provider using authorization code with PKCE
72608/wk11v?