[PR #3790] [MERGED] feat(oidc): add Client to getAdditionalUserInfoClaim #5005

Closed
opened 2026-03-13 12:07:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3790
Author: @grant0417
Created: 8/4/2025
Status: Merged
Merged: 8/6/2025
Merged by: @Bekacru

Base: canaryHead: canary


📝 Commits (3)

  • cc43574 feat: add oidc Client to getAdditionalUserInfoClaim
  • b69f282 address cubic comments
  • 9eab8f9 run format

📊 Changes

6 files changed (+35 additions, -9 deletions)

View changed files

📝 docs/content/docs/plugins/oidc-provider.mdx (+2 -2)
📝 packages/better-auth/src/plugins/mcp/index.ts (+5 -1)
📝 packages/better-auth/src/plugins/mcp/mcp.test.ts (+1 -1)
📝 packages/better-auth/src/plugins/oidc-provider/index.ts (+22 -2)
📝 packages/better-auth/src/plugins/oidc-provider/oidc.test.ts (+3 -3)
📝 packages/better-auth/src/plugins/oidc-provider/types.ts (+2 -0)

📄 Description

This PR enhances the OIDC provider's getAdditionalUserInfoClaim callback by adding the requesting client as a parameter.

What changed

The getAdditionalUserInfoClaim function signature now includes the client:

// Before
getAdditionalUserInfoClaim(user: User, scopes: string[])

// After  
getAdditionalUserInfoClaim(user: User, scopes: string[], client: Client)

This change allows more granular control over user claims based on which client is requesting them.


Summary by cubic

Added the client as a parameter to the OIDC provider's getAdditionalUserInfoClaim callback, allowing user claims to be customized based on the requesting client.

  • New Features
    • getAdditionalUserInfoClaim now receives (user, scopes, client) for more granular claim control.
    • Updated docs, types, and tests to reflect the new function signature.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/3790 **Author:** [@grant0417](https://github.com/grant0417) **Created:** 8/4/2025 **Status:** ✅ Merged **Merged:** 8/6/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `canary` --- ### 📝 Commits (3) - [`cc43574`](https://github.com/better-auth/better-auth/commit/cc43574139b124140119cecb15a502393039ef8c) feat: add oidc Client to getAdditionalUserInfoClaim - [`b69f282`](https://github.com/better-auth/better-auth/commit/b69f28268ae77c2e07cbc244d91213146722efe6) address cubic comments - [`9eab8f9`](https://github.com/better-auth/better-auth/commit/9eab8f999372d9f0d980e238be189c161409b32d) run format ### 📊 Changes **6 files changed** (+35 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/oidc-provider.mdx` (+2 -2) 📝 `packages/better-auth/src/plugins/mcp/index.ts` (+5 -1) 📝 `packages/better-auth/src/plugins/mcp/mcp.test.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/oidc-provider/index.ts` (+22 -2) 📝 `packages/better-auth/src/plugins/oidc-provider/oidc.test.ts` (+3 -3) 📝 `packages/better-auth/src/plugins/oidc-provider/types.ts` (+2 -0) </details> ### 📄 Description This PR enhances the OIDC provider's `getAdditionalUserInfoClaim` callback by adding the requesting client as a parameter. ## What changed The `getAdditionalUserInfoClaim` function signature now includes the client: ```typescript // Before getAdditionalUserInfoClaim(user: User, scopes: string[]) // After getAdditionalUserInfoClaim(user: User, scopes: string[], client: Client) ``` This change allows more granular control over user claims based on which client is requesting them. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added the client as a parameter to the OIDC provider's getAdditionalUserInfoClaim callback, allowing user claims to be customized based on the requesting client. - **New Features** - getAdditionalUserInfoClaim now receives (user, scopes, client) for more granular claim control. - Updated docs, types, and tests to reflect the new function signature. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:07:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5005