Add support for GitHub OAuth2 authentication #2901
Draft
+269
−56
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.
Pelican assumed OIDC with full discovery support. GitHub implements OAuth2 without OIDC extensions, causing three failure modes: metadata discovery overriding explicit endpoints, ID token parsing crashes, and required OIDC claims (
sub,iss) failing authentication.Changes
Respect explicit endpoint configuration
config/oidc_metadata.go: CheckIsSet()before overwriting endpoints from discovery metadataHandle missing OIDC ID tokens
web_ui/oauth2_client.go: Validate ID token is non-empty string before JWT parsingMake OIDC claims optional with fallbacks
Issuer.OIDCSubjectClaimandIssuer.OIDCIssuerClaim(defaults:sub,iss)OIDC.Issuerconfig or authorization endpoint hostnameExample Configuration
See
docs/github-oauth-config-example.yamlfor complete configuration.Backward compatible: existing OIDC providers (CILogon, Globus) work unchanged.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
abc123/tmp/go-build857477745/b845/config.test /tmp/go-build857477745/b845/config.test -test.testlogfile=/tmp/go-build857477745/b845/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m64 -mtune=generic -march=x86-64 -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -ato�� g_.a om/!azure/azure-sdk-for-go/sdk/a-ifaceassert ux_amd64/vet -errorsas /storage/remote/--64 -nilfunc ux_amd64/vet(dns block)/tmp/go-build1685999187/b845/config.test /tmp/go-build1685999187/b845/config.test -test.testlogfile=/tmp/go-build1685999187/b845/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m64 -mtune=generic -march=x86-64 -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -p pkg/mod/go.mongodb.org/[email protected]/bson-p pkg/mod/go.mongodb.org/[email protected]/bsonmain ux_amd64/compile -I /tmp/go-build202--64 -I ux_amd64/compile/tmp/ccGGdC8B.o(dns block)cilogon.org/tmp/go-build2144026736/b001/config.test /tmp/go-build2144026736/b001/config.test -test.testlogfile=/tmp/go-build2144026736/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true -test.run=TestGetMetadataRespectsExplicitEndpoints --local ux_amd64/compile credential.helpe/opt/hostedtoolcache/go/1.24.11/x64/pkg/tool/linux_amd64/vet(dns block)/tmp/go-build857477745/b845/config.test /tmp/go-build857477745/b845/config.test -test.testlogfile=/tmp/go-build857477745/b845/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m64 -mtune=generic -march=x86-64 -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -ato�� g_.a om/!azure/azure-sdk-for-go/sdk/a-ifaceassert ux_amd64/vet -errorsas /storage/remote/--64 -nilfunc ux_amd64/vet(dns block)/tmp/go-build1685999187/b845/config.test /tmp/go-build1685999187/b845/config.test -test.testlogfile=/tmp/go-build1685999187/b845/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m64 -mtune=generic -march=x86-64 -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -p pkg/mod/go.mongodb.org/[email protected]/bson-p pkg/mod/go.mongodb.org/[email protected]/bsonmain ux_amd64/compile -I /tmp/go-build202--64 -I ux_amd64/compile/tmp/ccGGdC8B.o(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.