Commit Graph

5558 Commits

Author SHA1 Message Date
Taesu
ae90b482d0 fix: correct wildcard pattern matching for trustedOrigins (#6904) 2025-12-23 14:08:58 +08:00
Paolo Ricciuti
cd77223b3b fix: don't set state query param if state is not provided (#6822) 2025-12-23 14:00:54 +08:00
Kasper
da820851a7 fix: use operator in list members where clause (#6850) 2025-12-23 14:00:41 +08:00
Nhan Nguyen
840d0e4b0c fix(cognito): use %20 encoding for scopes instead of + (#6929) 2025-12-23 14:00:15 +08:00
Alex Yang
9321632f3d fix(client): set session data on refreshManager (#6932)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-23 14:00:07 +08:00
Alex Yang
dc37a0fe64 chore(sso): remove Buffer usage (#6942) 2025-12-23 13:59:50 +08:00
Dhruv Jain
a0580b78fe docs: fix mongodb page join link (#6941) 2025-12-22 20:52:45 -08:00
d0
bf71de5f0b docs: add stargate to community plugins list (#6846) 2025-12-23 12:41:31 +08:00
Taesu
9d882ed5cf chore(demo): redirect to home when current session is removed (#6907) 2025-12-23 11:47:08 +08:00
Paola Estefanía de Campos
0e32d9c578 chore(sso): clean up SAML test suite (#6839) 2025-12-23 11:11:10 +08:00
Taesu
2bf224cad8 docs: correct OAuth Provider sidebar icon color (#6935) 2025-12-23 11:08:36 +08:00
Taesu
ec38c22938 fix(expo): add missing matcher paths (#6939) 2025-12-23 11:06:53 +08:00
Bereket Engida
9d784407ca chore: release v1.4.8-beta.7 v1.4.8-beta.7 2025-12-22 11:40:01 -08:00
Dylan Vanmali
686fba4e11 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 11:16:42 -08:00
Shawn Erquhart
525f0982ec 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 09:11:19 -08:00
Bereket Engida
52769504e1 chore: improve jsdoc comment for betterAuth instance (#6910) 2025-12-22 18:16:44 +08:00
renovate[bot]
356d9b5492 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 18:16:08 +08:00
Alex Yang
ed258bc5d6 chore: release v1.4.8-beta.6 v1.4.8-beta.6 2025-12-22 13:40:14 +08:00
Taesu
1c9a0f4af6 fix(stripe): update subscriptionId to use Stripe id (#6920) 2025-12-21 18:22:33 +08:00
Bereket Engida
1f8d54488e chore: release v1.4.8-beta.5 v1.4.8-beta.5 2025-12-20 13:28:09 -08:00
Shoubhit Dash
d544ba97f9 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 11:43:03 -08:00
Bereket Engida
30dc04b12f docs(organization): update default organization limit to 'unlimited' (#6808)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-20 07:38:11 -08:00
Alex Yang
cbd215f6ac fix: export necessary adapter types (#6903) 2025-12-20 16:33:13 +08:00
Alex Yang
6743a7a84b docs: clarify username sign-in functionality in documentation (#6901)
Co-authored-by: Jilles Soeters <jilleswf@gmail.com>
2025-12-20 16:17:04 +08:00
Factiven
fbafa0b9b3 fix(generic-oauth): ensure encryptOAuthTokens is respected in account linking flow (#6874) 2025-12-20 16:16:50 +08:00
Alex Yang
03ffcc9a7a chore(demo): add loading component for reset-password (#6900)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-20 16:03:35 +08:00
Alex Yang
5b2821e9fc chore: remove unused server-only package (#6899) 2025-12-20 15:29:36 +08:00
Alex Yang
e1dfdc3c27 chore(docs): bump tailwindcss (#6896) 2025-12-20 15:18:09 +08:00
Taesu
b1ca46f560 chore(demo): improve nextjs demo (#6727) 2025-12-19 23:02:12 -08:00
Maxwell
3d8eeb9f38 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-19 22:45:34 -08:00
Alex Yang
52640907e7 chore: update cspell 2025-12-20 13:20:04 +08:00
vijit-lark
cfb56fdab4 docs: add community plugin Lark billing (#6813) 2025-12-19 18:06:23 -08:00
Paola Estefanía de Campos
2f39d862f5 chore: add explicit type for trustedOrigins callback parameter (#6892) 2025-12-19 17:56:46 -08:00
Paola Estefanía de Campos
790764c1e1 deps(core): bump better-call to 1.1.7 (#6891) 2025-12-19 17:05:51 -08:00
Mauricio Galvez
becb4e96ee docs: fix typo in Organization plugin docs (#6885) 2025-12-19 16:41:04 -08:00
Paola Estefanía de Campos
65193cb56d doc(auth): clarify trustedOrigins callback request parameter (#6890) 2025-12-19 16:40:37 -08:00
Paola Estefanía de Campos
0d0a4edafd test(auth): handle undefined request in trustedOrigins test (#6888) 2025-12-19 15:26:14 -08:00
Bereket Engida
9af0a8b68b chore: support calling trusted origins callback during initalization 2025-12-19 15:03:00 -08:00
Bereket Engida
803459d9bb chore: release v1.4.8-beta.4 v1.4.8-beta.4 2025-12-19 14:52:04 -08:00
Bereket Engida
9469701b5f fix: trusted origins resolving (#6887) 2025-12-19 14:51:16 -08:00
Bereket Engida
ac6f495ac7 chore: only show base url warning once 2025-12-19 14:13:52 -08:00
Paola Estefanía de Campos
fc78c7c041 fix(sso): enforce domain verification in assignOrganizationByDomain (#6868) 2025-12-19 09:40:26 -08:00
Bereket Engida
39718e6c1d chore: release v1.4.8-beta.3 v1.4.8-beta.3 2025-12-19 09:09:24 -08:00
Paola Estefanía de Campos
19d2b3a990 fix(auth): respect trustedOrigins when baseURL is inferred (#6882) 2025-12-19 09:08:37 -08:00
Taesu
e9cd882f1f docs: use dotenv instead of env (#6883) 2025-12-19 09:03:46 -08:00
Bereket Engida
b9c346e944 chore: dispaly warning when baseURL isn't available (#6787) 2025-12-19 08:28:23 -08:00
Alex Yang
373a1c658a docs: fix twitter id 2025-12-19 22:25:00 +08:00
Gautam Manchandani
4981827262 docs: add baseURL configuration warning to Google provider (#6878)
Co-authored-by: Gautam Manchandani <gautammanch@Gautams-MacBook-Air.local>
2025-12-19 20:00:13 +08:00
Alex Yang
307acc9155 chore: release v1.4.8-beta.2 v1.4.8-beta.2 2025-12-19 16:53:21 +08:00
Joél Solano
48464f13cb chore: fix peer dependencies in package.json (#6855) 2025-12-19 16:53:06 +08:00