# FIX: OIDC missing idp attribute and ensureLocalIdPMetadata method#2616
Merged
monkeyiq merged 1 commit intofilesender:development3from Mar 17, 2026
Merged
Conversation
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.
Related issue: #2569
Related PR (partial fix, only idp on
developmentbranch): #2600The problem
When using native OIDC authentication (AuthSPOidc), creating a transfer causes:
Undefined array key 'idp'inTransfer.class.php(line 658)AuthSPOidc::ensureLocalIdPMetadata()— ifidpwere set, Transfer.class.php calls this method which doesn't exist in the OIDC classThis happens because AuthSPOidc was added (July 2025) without implementing two things that SAML and Shibboleth already had:
idpattribute inattributes()ensureLocalIdPMetadata()static methodWhat was changed
1.
classes/auth/AuthSPOidc.class.phpAdded
idpattribute (after the existinguid,email,nameattributes):How it works:
auth_sp_oidc_issuer(e.g.https://keycloak.example.com/realms/myrealm). This is always set becauseoidc.phpthrows an exception if it's missing.auth_sp_oidc_idp_attributeis configured (see below), reads the IdP from a claim in the OIDC userinfo response instead. This is useful for identity brokers (see "Optional: identity_provider claim" section below).Added
ensureLocalIdPMetadata()method:AuthSP::ensureLocalIdPMetadata()after creating a transfer to persist IdP metadata.($entityId, $idp, $force = false)matches AuthSPSaml (line 220) and AuthSPShibboleth (line 174).$idp->saveIfChanged()which is a method of theIdPclass (line 256).2.
classes/data/Transfer.class.phpLine 658 — defensive null coalescing:
idpattribute, this prevents the PHP warning.if ($entityId)check on the next line already handlesnullgracefully (skips IdP storage).3.
includes/ConfigDefaults.phpAdded new config default:
'auth_sp_oidc_idp_attribute' => null,nulldefault (disabled).Config::get('auth_sp_oidc_idp_attribute')could emit a PHP notice.uid_attribute,email_attribute,name_attribute,groups_claim).Optional:
identity_providerclaim for broker setupsBy default,
auth_sp_oidc_idp_attributeisnulland the issuer URL is used as the IdP identifier. This is correct for most setups (single OIDC provider).However, if your OIDC provider acts as an identity broker (e.g. Keycloak federating Google, Azure AD, SAML IdPs, etc.), you may want each transfer to record which upstream IdP the user actually came from, not just "Keycloak".
In that case, the OIDC provider needs to expose a claim with the upstream IdP name. For example, Keycloak can be configured to include an
identity_providerclaim in the userinfo response:{ "sub": "abc123", "email": "user@example.com", "name": "User", "identity_provider": "google" }To enable this in FileSender, add to your
config.php:The logic is:
auth_sp_oidc_idp_attributeis set AND the claim exists in the userinfo response, use that claim value (e.g."google")auth_sp_oidc_issuer(e.g."https://keycloak.example.com/realms/myrealm")This is entirely optional. If you don't configure it, nothing changes — the issuer URL is used.
Difference with PR #2600
PR #2600 (merged into
developmenton March 5, 2026) only adds one line:But not merged on
development3and this fix goes further:idp= issueridp_attribute)ensureLocalIdPMetadata()methodTransfer.class.phpdefensive?? nullConfigDefaults.phpregistrationWithout
ensureLocalIdPMetadata(), Transfer.class.php will still crash with a fatal error when creating transfers with OIDC authentication and theidpattribute is set.Closes #2569