Commit Graph
179 Commits
Author SHA1 Message Date
Dylan VanmaliandGitHub 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
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
Alex Yang ed258bc5d6 chore: release v1.4.8-beta.6 2025-12-22 13:40:14 +08:00
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 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 2025-12-19 14:52:04 -08:00
Bereket Engida 39718e6c1d chore: release v1.4.8-beta.3 2025-12-19 09:09:24 -08:00
Alex Yang 307acc9155 chore: release v1.4.8-beta.2 2025-12-19 16:53:21 +08:00
Alex Yang a345badd73 chore: release v1.4.8-beta.1 2025-12-19 01:16:42 +08:00
Alex YangandGitHub c091391d0b chore(db): remove deprecated types (#6793) 2025-12-17 16:18:54 +08:00
Muzzaiyyan HussainandGitHub 6444fd0fc5 chore: replace unsafe any in adapter factory types (#6819) 2025-12-17 16:11:53 +08:00
Alex YangandGitHub 63b961a5a9 chore: use Awaitable type (#6790) 2025-12-16 16:46:28 +08:00
noctarius aka Christoph EngelbertandGitHub eab5b4a04f feat: add additionalFields option in verification table schema (#6747) 2025-12-15 16:41:10 +09:00
Bereket Engida fd3460fadb chore: release v1.4.7 2025-12-13 22:47:53 -08:00
Bereket EngidaandGitHub 4cdf869c67 feat(phone-number): add password length validation for reset functionality (#6674) 2025-12-13 15:51:03 -08:00
Bereket EngidaandGitHub 12a9797ef3 fix(line): enforce nonce (#6631) 2025-12-13 15:41:12 -08:00
Bereket Engida 09d3222a2b chore: release v1.4.7-beta.4 2025-12-12 08:40:12 -08:00
Bereket Engida 3545c6a4ab chore: release v1.4.7-beta.3 2025-12-11 16:14:56 -08:00
Bereket Engida 4a3b391249 Revert "chore: independent pkg bumping (#6628)"
This reverts commit ce17ac2616.
2025-12-11 16:14:42 -08:00
744f30d665 chore: add support for scoped endpoints (#6275)
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
2025-12-11 12:22:12 -08:00
Dylan VanmaliandGitHub ce17ac2616 chore: independent pkg bumping (#6628) 2025-12-10 16:23:17 -08:00
Bereket Engida b1a23dc0fc chore: release v1.4.7-beta.2 2025-12-10 11:42:15 -08:00
Bereket Engida dbb8f5e959 chore: release v1.4.7-beta.1 2025-12-10 07:27:22 -08:00
Bereket Engida e2c4f8ea6e chore: release v1.4.6 2025-12-10 07:27:01 -08:00
Alex YangandGitHub bf5fbd48b1 chore: import async_hooks per conditional exports (#6630) 2025-12-10 13:55:24 +09:00
Jonathan SaminesandGitHub c55603ddc9 chore: add types linter (#6648) 2025-12-10 11:53:19 +09:00
Jonathan SaminesandGitHub 9233783428 chore: remove unused variables (#6647) 2025-12-09 13:51:35 -08:00
César Rodríguez VilagráandGitHub b1102e3458 feat: Add Refresh Token Support to Kick OAuth Provider (#6263) 2025-12-08 22:07:53 -08:00
Bereket Engida 57ca9e4cc6 chore: release v1.4.6-beta.4 2025-12-08 16:42:52 -08:00
MaxwellGitHubBereket Engidacubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
9d3d1d4c61 fix: array field handling across adapters and schema generation (#6601)
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-12-08 15:50:52 -08:00
Jonathan SaminesandGitHub ae03a52f96 chore: add nonce check and verifying jwt claims for google (#6614) 2025-12-08 13:49:31 -08:00
23e2edb6fc chore: configure code coverage for project (#6339)
Co-authored-by: Taesu <166604494+bytaesu@users.noreply.github.com>
2025-12-08 12:49:53 -08:00
Alex YangandGitHub 98f51117be fix(adapter): allow run internal adapter outside context (#6617) 2025-12-09 04:57:06 +09:00
MaxwellandGitHub aed7ab3efe fix(adapter): add logger creation in adapter factory (#6597) 2025-12-08 12:18:02 +09:00
Alex YangandGitHub c79b6e3aae chore: bump devDependencies (#6562) 2025-12-06 18:44:23 +09:00
Alex YangandGitHub 0ef0a1351b chore: fix types in package.json (#6560) 2025-12-06 18:22:17 +09:00
Alex YangandGitHub 3c6bed53c6 chore: update repository URLs in package.json (#6561) 2025-12-06 18:22:05 +09:00
Jonathan SaminesandGitHub 5436b95ada chore: remove unused exports and export types (#6513) 2025-12-04 22:30:15 -08:00
Bereket Engida 5327886f13 chore: release v1.4.6-beta.3 2025-12-04 18:57:19 -08:00
Alex YangandGitHub 5569af919d chore: async local storage fallback for convex (#6534) 2025-12-04 17:00:15 -08:00
Jonathan SaminesandGitHub d09c580bcb feat: add ctx.isTrustedDomain helper (#6462) 2025-12-04 12:45:10 -08:00
Josef ZollerandGitHub 088db0b5c1 fix(core): allow returning null in getUserInfo in provider options (#6528) 2025-12-04 10:33:06 -08:00
Alex YangandGitHub ed68935e5d refactor: move capitalizeFirstLetter to core (#6506) 2025-12-03 15:21:03 -08:00
b4f45848d1 fix: avoid throwing on client side (#6361)
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
2025-12-02 22:56:20 -08:00
6c83eca2a0 refactor: move adapter-factory to core (#6477)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-02 18:17:53 -08:00
Alex Yang dba28cd231 chore: release v1.4.6-beta.2 2025-12-02 15:57:36 -08:00
Alex Yang d8589776bd chore: release v1.4.6-beta.1 2025-12-02 15:53:53 -08:00
Alex Yang df7718558f chore: release v1.4.5-beta.2 2025-12-02 15:47:05 -08:00
Alex Yang c666670fbe chore: release v1.4.5-beta.1 2025-12-02 11:29:32 -08:00
Bereket Engida 189dedd006 chore: release v1.4.4-beta.3 2025-12-02 10:10:51 -08:00