Commit Graph
5523 Commits
Author SHA1 Message Date
Dylan Vanmaliandgithub-actions[bot] f1b90e4085 feat(oauth-provider): an oauth 2.1 compliant plugin (#4163)
An upgrade to oidc-provider plugin that makes it oauth2.1 compliant and has a configuration that is secure by default.

Plans for the deprecation of oidc-provider plugin due to many inherent flaws in its design. Internally, plugin functions now share logic, providing for better future extensibility if new code_grants need to be written or user/client jwt or opaque tokens need to be written. Furthermore, as an oAuth 2.1 provider, it provides logic valid for an MCP server. When using the scope "openid" (optional, enabled by default), the server acts like an OpenId server able to issue id tokens and provides a /userinfo endpoint.

Features

OAuth 2.1 by default
Properly supports authorization_code, refresh_token, and client_credentials grants
PKCE by default (removes plain completely)
Public and confidential client registration
JWT plugin is required by default, but can be disabled using disableJWTPlugin flag
Access tokens can now be received in JWT verifiable format using the resource parameter (ie JWT aud field)
Id tokens are still verifiable by JWKS when using JWT Plugin, or clientSecret if disabled. Fixes issue to prevent public clients when disableJWTPlugin: true from obtaining id tokens directly even when they shouldn't be allowed an id token and should use /userinfo instead.
Protects /userinfo with scope check
Separates Refresh Token and Access token on database schema to allow multiple access tokens per refresh and multiple refresh tokens per login session.
oauthAccessToken strictly deals with opaque tokens
Opaque tokens are given only when resource parameter (aka audience) is not provided
Option to Encode and Decode refresh tokens
allowDynamicClientRegistration with allowUnauthenticatedClientRegistration flags
Separation of default expiration times
Proper creation of public and confidential clients
Prevents misconfiguration between .well-known/openid-configuration endpoint and plugin settings
scopeExpirations to assign scopes specific expiration
Custom claims through separated functions: customAccessTokenClaims, customIdTokenClaims, and customUserInfoClaims
Organizational support through activeOrganizationalId on a session such as through the organizational plugin. Attaches to oAuthClient via reference_id.
Rp-initiated logout
Account Selection via prompt=select_account.
Account Creation via prompt=create.
Prompt combinations prompt=select_account+consent and prompt=login+consent

Docs available at https://www.better-auth.com/docs/plugins/oauth-provider (pr: https://github.com/better-auth/better-auth/blob/main/docs/content/docs/plugins/oauth-provider.mdx)
2025-12-22 19:16:54 +00:00
6d4aab5190 fix(adapter): apply customTransformInput to where clause values (#6914)
Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
2025-12-22 17:11:49 +00:00
Bereket Engidaandgithub-actions[bot] ad3c0b591f chore: improve jsdoc comment for betterAuth instance (#6910) 2025-12-22 10:16:57 +00:00
renovate[bot]github-actions[bot]renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
ae3b3f7386 chore(deps): update dependency deno to v2.6.3 (#6926)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-22 10:16:21 +00:00
Taesuandgithub-actions[bot] 35072dd59f fix(stripe): update subscriptionId to use Stripe id (#6920) 2025-12-21 10:22:45 +00:00
3e28ee00ea feat: add a global backgroundTasks config option to defer actions like sending email and updates to run after response is sent (#6713)
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
Co-authored-by: Bereket Engida <Bekacru@gmail.com>
2025-12-20 19:43:16 +00:00
14414c67a8 docs(organization): update default organization limit to 'unlimited' (#6808)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-20 15:38:26 +00:00
Alex Yangandgithub-actions[bot] 4551e095a1 fix: export necessary adapter types (#6903) 2025-12-20 08:33:28 +00:00
999a830b6f docs: clarify username sign-in functionality in documentation (#6901)
Co-authored-by: Jilles Soeters <jilleswf@gmail.com>
2025-12-20 08:17:18 +00:00
Factivenandgithub-actions[bot] 7e008cfac7 fix(generic-oauth): ensure encryptOAuthTokens is respected in account linking flow (#6874) 2025-12-20 08:17:05 +00:00
94856836cb chore(demo): add loading component for reset-password (#6900)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-20 08:03:50 +00:00
Alex Yangandgithub-actions[bot] e38f4d31ff chore: remove unused server-only package (#6899) 2025-12-20 07:29:51 +00:00
Alex Yangandgithub-actions[bot] 862fb3ddbf chore(docs): bump tailwindcss (#6896) 2025-12-20 07:18:20 +00:00
Taesuandgithub-actions[bot] be14d660b5 chore(demo): improve nextjs demo (#6727) 2025-12-20 07:02:26 +00:00
Maxwellgithub-actions[bot]cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
340938cff3 fix: update-user breaking during stateless auth (#6894)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-12-20 06:45:46 +00:00
vijit-larkandgithub-actions[bot] 92e8eca03d docs: add community plugin Lark billing (#6813) 2025-12-20 02:06:36 +00:00
Paola Estefanía de Camposandgithub-actions[bot] b37038ea48 chore: add explicit type for trustedOrigins callback parameter (#6892) 2025-12-20 01:56:59 +00:00
Paola Estefanía de Camposandgithub-actions[bot] 87bf226b3d deps(core): bump better-call to 1.1.7 (#6891) 2025-12-20 01:06:04 +00:00
Mauricio Galvezandgithub-actions[bot] bf6b225e7c docs: fix typo in Organization plugin docs (#6885) 2025-12-20 00:41:21 +00:00
Paola Estefanía de Camposandgithub-actions[bot] f58d9b98c9 doc(auth): clarify trustedOrigins callback request parameter (#6890) 2025-12-20 00:40:52 +00:00
Paola Estefanía de Camposandgithub-actions[bot] 037c97aec3 test(auth): handle undefined request in trustedOrigins test (#6888) 2025-12-19 23:26:31 +00:00
Paola Estefanía de Camposandgithub-actions[bot] 43cf2ddadd fix(sso): enforce domain verification in assignOrganizationByDomain (#6868) 2025-12-19 17:40:41 +00:00
Paola Estefanía de Camposandgithub-actions[bot] ac00442f5c fix(auth): respect trustedOrigins when baseURL is inferred (#6882) 2025-12-19 17:08:50 +00:00
Taesuandgithub-actions[bot] 1a2c570cbe docs: use dotenv instead of env (#6883) 2025-12-19 17:04:04 +00:00
8f22ecfd04 docs: add baseURL configuration warning to Google provider (#6878)
Co-authored-by: Gautam Manchandani <gautammanch@Gautams-MacBook-Air.local>
2025-12-19 12:00:27 +00:00
Joél Solanoandgithub-actions[bot] cc4a2567ee chore: fix peer dependencies in package.json (#6855) 2025-12-19 08:53:24 +00:00
Taesuandgithub-actions[bot] 000b3db728 chore: remove unnecessary custom word (#6825) 2025-12-19 05:57:35 +00:00
Taesuandgithub-actions[bot] eed8089c06 fix(passkey): use deleteVerificationByIdentifier instead of deleteVerificationValue (#6821) 2025-12-19 05:56:55 +00:00
Soham Dattaandgithub-actions[bot] c2eb2b77c4 docs(convex): fix import statement for authConfig (#6861) 2025-12-19 05:28:07 +00:00
Taesuandgithub-actions[bot] 646ff722a0 docs: fix AI chat code formatting issue (#6869) 2025-12-19 05:27:00 +00:00
Joél Solanoandgithub-actions[bot] c9a92bab5a chore: pass options to plugin configurations (#6858) 2025-12-19 04:16:21 +00:00
50cab87a20 fix(organization): allow internal organization creation when disabled for client (#6857)
Co-authored-by: Gautam Manchandani <gautammanch@Gautams-MacBook-Air.local>
2025-12-18 13:01:09 +00:00
Taesuandgithub-actions[bot] c01b867bd4 fix: respect IP headers in dev/test environments (#6854) 2025-12-18 12:25:26 +00:00
Bennett Damsandgithub-actions[bot] 6e67356355 docs: change role type from string to enum values (#6844) 2025-12-18 06:24:09 +00:00
Joél Solanoandgithub-actions[bot] 91cea0d0a7 chore(api-key): pass options to plugin config (#6843) 2025-12-18 05:47:01 +00:00
Dominik K.andgithub-actions[bot] a79ecc99b2 docs(convex): clean up documentation (#6829) 2025-12-18 02:27:52 +00:00
Dominik K.andgithub-actions[bot] 2f68a18cc7 docs(polar): update client import (#6830) 2025-12-18 02:26:57 +00:00
Taesuandgithub-actions[bot] 18e642ea1d docs: update logo for Christmas (#6806) 2025-12-18 01:14:23 +00:00
Anmolandgithub-actions[bot] 3176ecabee docs: uses latest getRequestHeaders() to grab headers from request in Auth Middleware in Tanstack Start (#6824) 2025-12-17 21:20:53 +00:00
Paola Estefanía de Camposandgithub-actions[bot] 94592d0a67 chore(sso): use default import for zod/v4 (#6833) 2025-12-17 20:44:14 +00:00
Alex Yangandgithub-actions[bot] 542616e77b chore(db): remove deprecated types (#6793) 2025-12-17 08:19:09 +00:00
Muzzaiyyan Hussainandgithub-actions[bot] 1010192e4a chore: replace unsafe any in adapter factory types (#6819) 2025-12-17 08:12:08 +00:00
Jonathan Saminesandgithub-actions[bot] fe696c8374 fix: delete verifications with hooks (#6803) 2025-12-17 04:15:43 +00:00
e76defb786 feat: add patreon social provider (#6245)
Co-authored-by: benkingcode <ben@lionfeet.com>
Co-authored-by: Kinfe123 <kinfishtech@gmail.com>
2025-12-17 03:57:14 +00:00
Alex Yangandgithub-actions[bot] 9487b1a4f1 test: add missing organizationId in addMember (#6814) 2025-12-17 03:34:16 +00:00
Paola Estefanía de Camposandgithub-actions[bot] bbc3dda17d feat(saml): enforce one-time use of SAML assertions (#6719) 2025-12-17 01:32:35 +00:00
Paola Estefanía de Camposandgithub-actions[bot] a790526f24 fix: respect BETTER_AUTH_TRUSTED_ORIGINS env variable (#6809) 2025-12-17 00:42:57 +00:00
Shawn Erquhartandgithub-actions[bot] 1a9b1a3e66 docs(convex): update guide for Convex component 0.10 (#6811) 2025-12-17 00:36:20 +00:00
Maxwellgithub-actions[bot]cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
9ba4291810 fix(prisma-adapter): extract id to root level for delete operations (#6425)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-12-16 21:40:47 +00:00
Alex Yangandgithub-actions[bot] 5beabbdf97 chore: use Awaitable type (#6790) 2025-12-16 08:46:43 +00:00