Plugin for PayloadCMS to integrate OAuth2
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-oauth2If 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 Continue with Google
}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.
No open issues yet, or sync has not completed.