Fix OIDC provider name uniqueness: allow multiple instances of same provider type via idp_id#27
Draft
Fix OIDC provider name uniqueness: allow multiple instances of same provider type via idp_id#27
Conversation
- Add optional idp_id attribute to XSD schema for unique provider instance identification - Update config parsing to use idp_id as config key, store provider_name separately - Add custom pipeline steps galaxy_social_user and galaxy_associate_user using idp_id - Update PSAAuthnz to separate idp_id from provider_name for backend class lookup - Fix provider_name_to_backend utility to return idp values (not PSA backend names) - Add Alembic migration to convert PSA backend names to config key names in DB - Update sample config with multi-instance example - Add comprehensive tests for all new functionality Agent-Logs-Url: https://github.com/mvdbeek/galaxy/sessions/973e824f-916d-42ee-88e6-d69040bb8e3f Co-authored-by: mvdbeek <6804901+mvdbeek@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix provider name uniqueness in Galaxy's OIDC configuration
Fix OIDC provider name uniqueness: allow multiple instances of same provider type via idp_id
Apr 7, 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.
Galaxy's OIDC config used
nameas both the provider type and unique identifier, making it impossible to configure two instances of the same provider (e.g., two Keycloak realms or multiple genericoidcendpoints). The latter declaration silently overwrote the former.Changes
New
idp_idattribute (optional, backward-compatible)name.lower()— existing configs need no changes.oidc_backends_configdict key and URL slug (/authnz/{idp_id}/login).nameis retained solely for backend class lookup (must still be a known provider type).Example — two Keycloak instances:
PSA pipeline: token storage now uses
idp_idsocial_core.pipeline.social_auth.social_userandassociate_userwith Galaxy-specific versions (galaxy_social_user,galaxy_associate_user) that useidp_idinstead ofbackend.namewhen reading/writingUserAuthnzToken.provider.PSAAuthnznow stores bothidp_id(for DB/URL) andprovider(for BACKENDS class lookup) in its config.DB migration (
d05a9e6a4b51)oidc_user_authnz_tokens.providerfrom PSA backend names to config key names for providers where they differ:google-openidconnectgooglelife_sciencelifesciencee-infra_czeinfraczinfraproxynfdiokta-openidconnectoktaazuread-v2-tenant-oauth2azureegi-checkinegi_checkinprovider_name_to_backend(authnz/util.py)idp_id) instead of the PSA backend name, soget_oidc_tokens()lookups continue to work post-migration.How to test the changes?
New unit tests in
test/unit/authnz/test_authnz.pycover:idp_idas config key, default backward-compat behavior, two providers of the same type, duplicateidp_iderror, andPSAAuthnzconfig separation.License