Adds OAuth sign-in with Google and Microsoft (Entra ID) to Payload's default authentication. It registers login and callback endpoints per provider and adds an 'or login with' button area to the admin login form. Existing users are matched by provider-verified email, and matching can be customized with a callback. Requires Payload 3 and regenerating the admin import map.
Simple social login (Google and Microsoft) for Payload default authentication.
Installation
npm i payload-simple-social-login3
Stars
0
Forks
0
Open Issues
Yesterday
Last Updated
20
Weekly Downloads
v1.1.3
npm Version
185.8 KB
Unpacked Size
0
Dependencies
3+1 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 3 |
| Dec 4, 2026 | 3 |
| Dec 3, 2026 | 3 |
| Dec 2, 2026 | 3 |
| Dec 1, 2026 | 3 |
| Nov 30, 2026 | 3 |
| Nov 29, 2026 | 3 |
| Nov 28, 2026 | 3 |
| Nov 27, 2026 | 3 |
| Nov 26, 2026 | 3 |
| Nov 25, 2026 | 3 |
| Nov 24, 2026 | 3 |
| Nov 23, 2026 | 3 |
| Nov 22, 2026 | 3 |
| Nov 21, 2026 | 3 |
| Nov 20, 2026 | 3 |
| Nov 19, 2026 | 3 |
| Nov 18, 2026 | 3 |
| Nov 17, 2026 | 3 |
| Nov 16, 2026 | 3 |
| Nov 15, 2026 | 3 |
| Nov 14, 2026 | 3 |
| Nov 13, 2026 | 3 |
| Nov 12, 2026 | 3 |
| Nov 11, 2026 | 3 |
| Nov 10, 2026 | 3 |
| Nov 9, 2026 | 3 |
| Nov 8, 2026 | 3 |
| Nov 7, 2026 | 3 |
| Nov 6, 2026 | 3 |
| Nov 5, 2026 | 3 |
| Nov 4, 2026 | 3 |
| Nov 3, 2026 | 3 |
| Nov 2, 2026 | 3 |
| Nov 1, 2026 | 3 |
| Oct 31, 2026 | 3 |
| Oct 30, 2026 | 3 |
| Oct 29, 2026 | 3 |
| Oct 28, 2026 | 3 |
| Oct 27, 2026 | 3 |
| Oct 26, 2026 | 3 |
| Oct 25, 2026 | 3 |
| Oct 24, 2026 | 3 |
| Oct 23, 2026 | 3 |
| Oct 22, 2026 | 3 |
| Oct 21, 2026 | 3 |
| Oct 20, 2026 | 3 |
| Oct 19, 2026 | 3 |
| Oct 18, 2026 | 3 |
| Oct 17, 2026 | 3 |
| Oct 16, 2026 | 3 |
| Oct 15, 2026 | 3 |
| Oct 14, 2026 | 3 |
| Oct 13, 2026 | 3 |
| Oct 12, 2026 | 3 |
| Oct 11, 2026 | 3 |
| Oct 10, 2026 | 3 |
| Oct 9, 2026 | 3 |
| Oct 8, 2026 | 3 |
| Oct 7, 2026 | 3 |
| Oct 6, 2026 | 3 |
| Oct 5, 2026 | 3 |
| Oct 4, 2026 | 3 |
| Oct 3, 2026 | 3 |
| Oct 2, 2026 | 3 |
| Oct 1, 2026 | 3 |
| Sep 30, 2026 | 3 |
| Sep 29, 2026 | 2 |
| Sep 28, 2026 | 2 |
| Sep 27, 2026 | 2 |
| Sep 26, 2026 | 2 |
| Sep 25, 2026 | 2 |
| Sep 24, 2026 | 2 |
| Sep 23, 2026 | 2 |
| Sep 22, 2026 | 2 |
| Sep 21, 2026 | 2 |
| Sep 20, 2026 | 2 |
| Sep 19, 2026 | 2 |
| Sep 18, 2026 | 2 |
| Sep 17, 2026 | 2 |
| Sep 16, 2026 | 2 |
| Sep 15, 2026 | 2 |
| Sep 14, 2026 | 2 |
| Sep 13, 2026 | 2 |
| Sep 12, 2026 | 2 |
| Sep 11, 2026 | 2 |
| Sep 10, 2026 | 2 |
| Sep 9, 2026 | 2 |
| Sep 8, 2026 | 2 |
| Sep 7, 2026 | 2 |
| Sep 6, 2026 | 2 |
15−273 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 15 |
| Dec 4, 2026 | 21 |
| Dec 3, 2026 | 21 |
| Dec 2, 2026 | 30 |
| Dec 1, 2026 | 35 |
| Nov 30, 2026 | 41 |
| Nov 29, 2026 | 42 |
| Nov 28, 2026 | 52 |
| Nov 27, 2026 | 54 |
| Nov 26, 2026 | 54 |
| Nov 25, 2026 | 41 |
| Nov 24, 2026 | 38 |
| Nov 23, 2026 | 32 |
| Nov 22, 2026 | 34 |
| Nov 21, 2026 | 22 |
| Nov 20, 2026 | 9 |
| Nov 19, 2026 | 14 |
| Nov 18, 2026 | 21 |
| Nov 17, 2026 | 21 |
| Nov 16, 2026 | 25 |
| Nov 15, 2026 | 24 |
| Nov 14, 2026 | 29 |
| Nov 13, 2026 | 29 |
| Nov 12, 2026 | 32 |
| Nov 11, 2026 | 26 |
| Nov 10, 2026 | 29 |
| Nov 9, 2026 | 26 |
| Nov 8, 2026 | 25 |
| Nov 7, 2026 | 25 |
| Nov 6, 2026 | 48 |
| Nov 5, 2026 | 41 |
| Nov 4, 2026 | 40 |
| Nov 3, 2026 | 41 |
| Nov 2, 2026 | 45 |
| Nov 1, 2026 | 44 |
| Oct 31, 2026 | 41 |
| Oct 30, 2026 | 21 |
| Oct 29, 2026 | 20 |
| Oct 28, 2026 | 20 |
| Oct 27, 2026 | 23 |
| Oct 26, 2026 | 23 |
| Oct 25, 2026 | 28 |
| Oct 24, 2026 | 28 |
| Oct 23, 2026 | 23 |
| Oct 22, 2026 | 31 |
| Oct 21, 2026 | 39 |
| Oct 20, 2026 | 187 |
| Oct 19, 2026 | 187 |
| Oct 18, 2026 | 186 |
| Oct 17, 2026 | 183 |
| Oct 16, 2026 | 184 |
| Oct 15, 2026 | 192 |
| Oct 14, 2026 | 191 |
| Oct 13, 2026 | 44 |
| Oct 12, 2026 | 39 |
| Oct 11, 2026 | 39 |
| Oct 10, 2026 | 42 |
| Oct 9, 2026 | 52 |
| Oct 8, 2026 | 39 |
| Oct 7, 2026 | 33 |
| Oct 6, 2026 | 30 |
| Oct 5, 2026 | 37 |
| Oct 4, 2026 | 33 |
| Oct 3, 2026 | 38 |
| Oct 2, 2026 | 27 |
| Oct 1, 2026 | 26 |
| Sep 30, 2026 | 27 |
| Sep 29, 2026 | 22 |
| Sep 28, 2026 | 26 |
| Sep 27, 2026 | 26 |
| Sep 26, 2026 | 27 |
| Sep 25, 2026 | 32 |
| Sep 24, 2026 | 36 |
| Sep 23, 2026 | 40 |
| Sep 22, 2026 | 61 |
| Sep 21, 2026 | 53 |
| Sep 20, 2026 | 59 |
| Sep 19, 2026 | 51 |
| Sep 18, 2026 | 92 |
| Sep 17, 2026 | 238 |
| Sep 16, 2026 | 236 |
| Sep 15, 2026 | 213 |
| Sep 14, 2026 | 221 |
| Sep 13, 2026 | 228 |
| Sep 12, 2026 | 234 |
| Sep 11, 2026 | 202 |
| Sep 10, 2026 | 62 |
| Sep 9, 2026 | 73 |
| Sep 8, 2026 | 91 |
| Sep 7, 2026 | 130 |
| Sep 6, 2026 | 288 |
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/1346529929-root)<a href="https://payloaddirectory.dev/plugins/1346529929-root"><img src="https://payloaddirectory.dev/badge/1346529929-root.svg" alt="Payload Directory"></a>README
A Payload CMS plugin for social login (OAuth) on the admin panel and authenticated collections.
It adds an “or login with” UI to the login form and OAuth endpoints per provider. Supported in this version: Google and Microsoft (Entra ID).
This project follows Semantic Versioning (MAJOR.MINOR.PATCH). See CHANGELOG.md for release notes.
Install the package, add the plugin to your Payload config, then regenerate the admin import map so the login buttons resolve:
pnpm add payload-simple-social-login
pnpm payload generate:importmap
(or npx payload generate:importmap / your package manager’s equivalent)
Without this step, the afterLogin social buttons may not appear in the admin panel.
Paste this into any coding agent to wire the plugin with the defaults (email match on admin.user, no auto-create):
Install and configure payload-simple-social-login in this Payload CMS project the simplest way:
1. Add the dependency (pnpm/npm/yarn as used here).
2. Register payloadSimpleSocialLogin in payload.config with only the providers we need (google and/or microsoft), reading clientId/clientSecret from env vars. Leave callbackURL, loginUrl, collections, and findUserCallback unset so defaults apply (match existing users by profile email on admin.user; default also respects `auth.verify`).
3. Check env vars from .env and add to .env.sample or .env.example (do not create anything new; if secrets are needed, add empty placeholders and ask the user to fill them in).
4. Document the OAuth redirect URIs as {APP_ORIGIN}{routes.api}/auth/{provider}/callback (e.g. http://localhost:3000/api/auth/google/callback).
5. Run the project's Payload generate:importmap command so admin login buttons appear.
import { buildConfig } from 'payload'
import { payloadSimpleSocialLogin } from 'payload-simple-social-login'
import type { FindUserCallback } from 'payload-simple-social-login/types'
export default buildConfig({
// ...
plugins: [
payloadSimpleSocialLogin({
providers: {
google: {
clientId: process.env.GOOGLE_CLIENT_ID!,
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
// callbackURL: '/auth/google/callback',
// loginUrl: '/auth/google/login',
// label: 'Continue with Google',
},
microsoft: {
clientId: process.env.MICROSOFT_CLIENT_ID!,
clientSecret: process.env.MICROSOFT_CLIENT_SECRET!,
// tenant: 'common',
},
},
// collections: [{ collection: 'users' }],
// serverURL: 'https://app.example.com',
showButtonOnLogin: true,
// disabled: false,
}),
],
})
| Option | Description |
|---|---|
providers | Required. Enable google and/or microsoft with clientId / clientSecret. |
providers.*.callbackURL | OAuth callback path. Default /auth/{providerId}/callback (public URL under routes.api). |
providers.*.loginUrl | Login start path (button href + endpoint). Default /auth/{providerId}/login. |
providers.*.label | Button label; falls back to plugin i18n. |
providers.microsoft.tenant | Entra tenant segment. Default common. Pin a tenant ID or domain when only one directory should sign in. See Microsoft tenant. |
providers.*.serverURL | Optional. Origin used to build this provider redirect_uri (https://app.example.com). String or (req) => string | null. Takes precedence over the plugin serverURL and over serverURL from the Payload config. |
collections | Auth collections to resolve users for. When omitted: [{ collection: admin.user }] with email match. |
collections[].autoVerify | Optional. Default find only: if the collection has auth.verify and the user is unverified, set _verified: true (only that field) and continue. Default false. Ignored when findUserCallback is set. |
collections[].findUserCallback | Optional. Locate (or create, in your app) a user. When omitted: match by profileEmail and respect auth.verify / autoVerify. |
serverURL | Optional. Same as providers.*.serverURL, applied to every provider. Used when the provider does not define its own. See Deploying behind a proxy. |
showButtonOnLogin | Show buttons on the admin login form. Default true. |
disabled | Skip registering endpoints and UI. Default false. |
The OAuth redirect_uri must be the public URL of the app, and both the login and the callback endpoints must send the exact same value, otherwise the IdP answers redirect_uri_mismatch.
The plugin resolves the origin in this order:
serverURL from the plugin options (providers.*.serverURL first, then the top level serverURL)serverURL from the Payload configHost header, and only when that origin is listed in cors / csrfreq.url, with a warning recommending serverURLStep 4 is the fallback that breaks behind a proxy. req.url is not the public URL: Next builds it as ${protocol}://${fetchHostname}:${port}${req.url}, where the hostname falls back to localhost and the port is the internal container port, so the callback becomes something like https://localhost:80/api/auth/microsoft/callback. The real public host travels in the Host header. Payload also defaults serverURL to an empty string, so this fallback is the common path, not an edge case.
Steps 3 and 4 mirror what Payload core does in getRequestOrigin (used for verification and reset password links): the Host header is only trusted when it is in the CORS / CSRF allowlist, since it is client controlled. A cors: '*' is not an allowlist and is never trusted.
Pick one of these in production:
export default buildConfig({
// Recommended: single public origin for the whole app
serverURL: process.env.PAYLOAD_PUBLIC_SERVER_URL, // https://app.example.com
// or, keeping serverURL empty, allowlist the public origin
cors: ['https://app.example.com'],
csrf: ['https://app.example.com'],
})
When one process serves more than one public host (admin on one domain, SSO on another), use the function form. It runs per request, so nothing needs to mutate the shared req.payload.config.serverURL:
payloadSimpleSocialLogin({
providers: { microsoft: { clientId, clientSecret } },
serverURL: (req) => {
const host = req.headers.get('host')
return host ? `https://${host}` : null
},
})
Return null or undefined to fall back to the next source in the chain. Register every resulting redirect URI in the IdP console.
The Secure flag of the OAuth state cookie follows the same logic: x-forwarded-proto first, then the resolved origin.
The plugin only accepts emails verified by the provider. There is no option to sign in with an unverified address: without one, login fails with email_unverified and neither findUserCallback nor onSuccess runs.
Since 1.1.3, profileEmail is only set to an address the provider vouches for, trimmed and lowercased (Payload stores auth emails in lowercase and the default match is an exact equals):
| Arg | Microsoft | |
|---|---|---|
profileId | sub | id |
profileEmail | email, only when email_verified === true | userPrincipalName only; never mail |
email_verified as a boolean. Any other value (false, missing, a string, a number) means no profileEmail.#EXT#, any case) means no profileEmail.mail is ignored: a tenant admin can set mail to any address without proving they own its domain, so it does not identify a person across tenants. Microsoft's own guidance is that apps should never use the email claim for authorization. Users whose mail differs from their UPN sign in by the UPN; make sure the Payload account uses that address.When there is no such address, the callback stops with email_unverified before onSuccess, before any findUserCallback, and before any database lookup. No flow receives profileEmail: null.
[!WARNING] In
findUserCallbackandonSuccess, match, link, or create accounts withprofileEmail(orprofileId), never withprofile.emailorprofile.mail. The rawprofileis passed through untouched, so reading the email from it skips every check above. The only exception is a pinned, trusted tenant: see Example: also accept Microsoft
The default tenant: 'common' stays, because accepting work, school, and personal accounts from any tenant is a legitimate use. Since matching uses only the UPN, accepting any tenant does not let one directory sign in as another directory's users.
When only one directory should sign in (an internal admin panel, for example), pin it anyway:
microsoft: {
clientId: process.env.MICROSOFT_CLIENT_ID!,
clientSecret: process.env.MICROSOFT_CLIENT_SECRET!,
tenant: process.env.MICROSOFT_TENANT_ID!, // or 'contoso.com'
},
After OAuth, the plugin normalizes profileEmail and profileId (see How accounts are matched) and calls each collection’s findUserCallback (or the default email match). The first returned user is logged in (JWT cookie) and the browser is redirected to the admin panel. If none match → /admin/login?ssl-error=not_found.
Default email match and auth.verify. When you omit findUserCallback, the plugin also checks the collection’s auth.verify. If verification is required and the matched user has _verified === false, login is denied with ssl-error=unverified (toast), instead of issuing a session that Payload’s JWT strategy would reject silently. Set collections[].autoVerify: true to update only _verified to true on that match and continue login. If the collection has no auth.verify, neither the reject nor the auto-update runs.
Custom findUserCallback owns verification. If you override the callback, the plugin does not enforce _verified. You can mark the user verified (e.g. after a trusted IdP email), return null, or return an unverified user. In that last case the plugin still issues a JWT and the admin panel may bounce to /admin/login with no toast (user: null from Payload’s JWT strategy).
This plugin never auto-creates users and will not add a built-in create path. Payload has no standardized way to create auth users (required fields, password, verify, roles, tenants, hooks differ per app). Provisioning belongs in your findUserCallback if you want it.
Link / unlink of OAuth accounts is also out of scope. If you need that, model your own collection (e.g. oauth-accounts with provider, profileId, relation to the user) and override findUserCallback to resolve users through it.
Use when the collection has auth: { verify: true } and a successful OAuth login is enough to mark the existing Payload user verified. Does not create users; only sets _verified: true on match.
Has no effect if you set findUserCallback. Then you own _verified yourself.
collections: [
{
collection: 'users',
autoVerify: true,
},
]
collections: [
{
collection: 'users',
findUserCallback: async ({ payload, profileEmail, profileId }) => {
const existing = await payload.find({
collection: 'users',
limit: 1,
overrideAccess: true,
where: { email: { equals: profileEmail } },
})
if (existing.docs[0]) return existing.docs[0]
return payload.create({
collection: 'users',
data: {
email: profileEmail,
// Optional: store IdP subject on a custom field for linking.
// googleSub / microsoftId: profileId,
// Auth collections still require a password; use an unguessable value (user signs in via social, not password).
password: crypto.randomUUID(),
},
overrideAccess: true,
})
},
},
]
mail (trusted tenant only)This does not relax the rule above: the user still needs a verified UPN to reach the callback, and mail only becomes an extra lookup key decided by your app. Some directories register people in Payload by their mail while their UPN is different (e.g. UPN [email protected], mail [email protected]). Since 1.1.3 those users get not_found. If you cannot change the Payload emails to the UPN, a findUserCallback can fall back to mail.
[!CAUTION]
tenantpinned to a directory you control or fully trust, never withcommon,organizationsorconsumers. With those, anyone can create a tenant and sign in as any of your users.
payloadSimpleSocialLogin({
providers: {
microsoft: {
clientId: process.env.MICROSOFT_CLIENT_ID!,
clientSecret: process.env.MICROSOFT_CLIENT_SECRET!,
// Required by the fallback below: only this directory can reach the callback.
tenant: process.env.MICROSOFT_TENANT_ID!,
},
},
collections: [
{
collection: 'users',
findUserCallback: async ({ payload, profile, profileEmail, provider }) => {
const findByEmail = async (email: string) => {
const result = await payload.find({
collection: 'users',
limit: 1,
overrideAccess: true,
where: { email: { equals: email } },
})
const user = result.docs[0]
return user ? { ...user } : null
}
// The verified UPN always wins, so `mail` can never shadow another account's UPN match.
const byUpn = await findByEmail(profileEmail)
if (byUpn || provider !== 'microsoft') return byUpn
// Safe only because `tenant` is pinned to a trusted directory.
const mail = typeof profile.mail === 'string' ? profile.mail.trim().toLowerCase() : ''
return mail ? findByEmail(mail) : null
},
},
],
})
Things to keep in mind:
#EXT#), accounts without an email-shaped UPN and Google accounts with an unverified email stop with email_unverified before any findUserCallback runs, so a callback cannot accept them.findUserCallback owns auth.verify: the plugin does not check _verified here.provider check so Google never uses this path.createSocialAuthEndpoints (each with its own tenant, loginUrl and callbackURL) instead of widening tenant. Graph /me does not tell which tenant the user came from, so the pinned tenant is the only check available.OAuth callback failures redirect to the admin login form with ?ssl-error=<code> and a toast:
| Code | When | Toast |
|---|---|---|
email_unverified | The provider returned no email it vouches for (Google email_verified not true; Microsoft UPN missing, not an email, or a guest). See How accounts are matched | No verified email on this account |
login | Invalid/missing state, missing code, IdP error, token/profile failure | Generic “try again” |
not_found | No Payload user returned from findUserCallback / default email match | Account not found |
unverified | Default findUser: collection has auth.verify, matched user has _verified: false, and autoVerify is not enabled | Please verify your email before logging in |
email_unverified and unverified are different checks: the first is about the provider account (no verified email from Google or Microsoft), the second about the Payload user (_verified: false in a collection with auth.verify).
In custom flows the same codes reach onError as code (without onError, the response is { "error": "<code>" } with status 404 for not_found and 400 otherwise).
Toast messages come from the plugin-simple-social-login i18n namespace and can be overridden in i18n.translations:
| Code | Key | Default (en) |
|---|---|---|
email_unverified | providerEmailNotVerified | This account has no verified email address we can use. Sign in with an account whose email is verified, or ask an admin for access. |
login | loginFailed | Something went wrong. Please try again. |
not_found | userNotFound | No account found for this email. Ask an admin for access. |
unverified | emailNotVerified | Please verify your email before logging in. |
Use createSocialAuthEndpoints when you need extra OAuth flows (frontend app, account linking, JSON callback) without duplicating provider logic. It accepts the same provider config as the plugin (clientId, clientSecret, optional loginUrl / callbackURL, serverURL, tenant for Microsoft).
Register the returned pair on config.endpoints. You do not need the plugin in plugins[] for custom-only flows; use both when you want admin login plus extra URLs.
Admin default (plugin): pass collections and omit onSuccess. Same as payloadSimpleSocialLogin: find user, JWT cookie, redirect to /admin.
Custom flow: pass onSuccess (and optional onError). After token exchange and IdP profile fetch, your callback returns a Response. No automatic Payload login. profileEmail is always a verified, lowercased address: when the provider gives none, onSuccess is not called and onError receives code: 'email_unverified' (without onError, the response is 400 { "error": "email_unverified" }).
The callback endpoint always clears the OAuth state cookie on the final response. You do not set that cookie in onSuccess / onError.
Each flow gets its own state cookie name from provider + callbackURL, so two Google flows (e.g. admin + app) do not overwrite each other. Register each redirect URI in the IdP console.
import { buildConfig } from 'payload'
import { createSocialAuthEndpoints, payloadSimpleSocialLogin } from 'payload-simple-social-login'
import type { SocialAuthOnSuccess } from 'payload-simple-social-login/types'
const google = {
clientId: process.env.GOOGLE_CLIENT_ID!,
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
}
const appGoogleSuccess: SocialAuthOnSuccess = async ({ req, profileEmail, profileId }) => {
// Your logic: find-or-create, link account, issue your own session, etc.
// Match by profileEmail / profileId, never by profile.email or profile.mail.
return new Response(null, {
headers: { Location: '/app' },
status: 302,
})
}
export default buildConfig({
endpoints: [
...createSocialAuthEndpoints({
provider: 'google',
...google,
loginUrl: '/app/google/login',
callbackURL: '/app/google/callback',
onSuccess: appGoogleSuccess,
onError: () =>
new Response(null, {
headers: { Location: '/app/login?error=oauth' },
status: 302,
}),
}),
],
plugins: [
payloadSimpleSocialLogin({
providers: { google },
}),
],
})
Types: CreateSocialAuthEndpointsArgs, SocialLoginServerURL, SocialAuthOnSuccess, SocialAuthOnSuccessArgs, SocialAuthOnError, SocialAuthOnErrorArgs, SocialAuthErrorCode from payload-simple-social-login/types.
findUserCallback)findUserCallback)createSocialAuthEndpoints + your own UI)After a successful OAuth callback, the plugin loads the user profile from the IdP (not by decoding the access token). You receive it as profile in findUserCallback, plus normalized profileEmail / profileId. Use profile for display fields only; account matching belongs to profileEmail / profileId (see How accounts are matched).
Use the exported TypeScript types from payload-simple-social-login/types (GoogleUserInfoProfile, MicrosoftGraphMeProfile, FindUserCallback, etc.). Extra keys may appear depending on scopes / tenant; treat unknown fields as optional.
Endpoint: GET https://openidconnect.googleapis.com/v1/userinfo
Docs: UserInfo response fields
Typical payload (fictional):
{
"sub": "100000000000000000001",
"name": "Ada Lovelace",
"given_name": "Ada",
"family_name": "Lovelace",
"picture": "https://lh3.googleusercontent.com/a/example-avatar",
"email": "[email protected]",
"email_verified": true,
"hd": "example.com"
}
| Field | Notes |
|---|---|
sub | Stable Google account id (preferred for long-term linking) |
email / email_verified | From email scope. email becomes profileEmail only when email_verified is true |
name, given_name, family_name, picture | From profile scope |
hd | Hosted domain for Google Workspace only; omitted for personal Gmail |
/me)Endpoint: GET https://graph.microsoft.com/v1.0/me
Docs: Get user · user resource
Typical default payload (fictional). Graph returns only this common subset unless you $select more fields (this plugin does not $select today):
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
"businessPhones": [],
"displayName": "Ada Lovelace",
"givenName": "Ada",
"jobTitle": null,
"mail": "[email protected]",
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": "Lovelace",
"userPrincipalName": "[email protected]",
"id": "00000000-0000-0000-0000-000000000001"
}
| Field | Notes |
|---|---|
id | Stable Entra / MSA object id (GUID; preferred for long-term linking) |
mail | SMTP address; may be null. Editable by tenant admins without domain proof; never used for matching |
userPrincipalName | Sign-in name in a tenant-verified domain; becomes profileEmail (guests with #EXT# excluded) |
displayName, givenName, surname | Display / name fields |
businessPhones, jobTitle, mobilePhone, officeLocation, preferredLanguage | Often empty/null depending on the account |
@odata.context | Graph metadata URL; ignore for matching |
See CONTRIBUTING.md.
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 oauth2
Generic OAuth2 sign-in for Payload CMS with support for providers such as Google, Zitadel and Apple
6913.0k/wk200v3
oidc
OpenID Connect single sign-on for Payload using Authorization Code Flow with PKCE and native Payload sessions
65745/wk0v3
payload github auth
Sign in to the Payload admin with a GitHub App, with access rules by email, org or team
6021/wk0v4
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