Add custom_attributes field to OrganizationMembership#318
Merged
Conversation
- Add @Property array<string, mixed> $idpAttributes to PHPDoc - Add "idpAttributes" to RESOURCE_ATTRIBUTES array - Add "idp_attributes" => "idpAttributes" to RESPONSE_TO_RESOURCE_KEY mapping - Update test fixtures to include idp_attributes field - All 13 tests pass This change adds support for IDP custom attributes on organization memberships, which are sourced from the identity provider and stored as customAttributes in the API. Related to workos/workos PR #50470 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Greptile OverviewGreptile SummaryThis PR adds the Key Changes:
Implementation: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant API as WorkOS API
participant Client as PHP SDK Client
participant Resource as OrganizationMembership Resource
participant App as Application Code
API->>Client: Response with idp_attributes field
Note over API,Client: JSON: {"idp_attributes": {"department": "eng"}}
Client->>Resource: constructFromResponse($response)
Note over Resource: Maps "idp_attributes" → "idpAttributes"
Resource->>Resource: Store in $values["idpAttributes"]
App->>Resource: Access $membership->idpAttributes
Resource->>App: Returns array<string, mixed>
Note over App: Contains IDP custom attributes
|
mattgd
approved these changes
Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
custom_attributesfield toOrganizationMembershipmodel to expose custom attributes from identity providers.Changes
custom_attributesfield to OrganizationMembership type/model{}API Field Details
The field will be present in:
JSON field name:
custom_attributes(snake_case)