Repository navigation
Add OPENSHIFT_LOGIN_IDP to skip the IdP chooser page - #2
Merged
Merged
Conversation
OpenShift's OAuth server shows an identity-provider chooser page before redirecting to the actual IdP when the authorize request doesn't specify one. Setting OPENSHIFT_LOGIN_IDP to a configured IdP name now adds it as the `idp` query parameter on the authorize request, skipping the chooser. Unset (default) keeps the existing chooser behavior. Claude-Session: https://claude.ai/code/session_012VuiD96S6BWQDNCbrKxzM2
There was a problem hiding this comment.
🟡 Changes recommended
Minor but concrete implementation issues (whitespace handling and Go formatting consistency) should be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds an optional environment-variable override to force OpenShift OAuth to skip the identity-provider chooser by setting the idp query parameter on the authorization request, while preserving existing behavior when unset.
Changes:
- Read
OPENSHIFT_LOGIN_IDPand, when set, appendoauth2.SetAuthURLParam("idp", ...)to OAuth2 auth code options. - Document
OPENSHIFT_LOGIN_IDPusage in the kubeconfig exec env example and in the README “How It Works” section.
File summaries
| File | Description |
|---|---|
| README.md | Documents the new OPENSHIFT_LOGIN_IDP env var and shows an example kubeconfig entry. |
| main.go | Adds optional idp parameter injection into the OAuth2 authorization request options. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Addresses Copilot review feedback: a trailing/leading whitespace value (e.g. from a stray newline in an env file) would otherwise produce an invalid idp query parameter. Claude-Session: https://claude.ai/code/session_012VuiD96S6BWQDNCbrKxzM2
# Conflicts: # README.md
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
OpenShift's OAuth server shows an identity-provider chooser page before redirecting to the actual IdP whenever the authorize request doesn't specify one. This adds an optional
OPENSHIFT_LOGIN_IDPenvironment variable: when set, its (trimmed) value is passed as theidpquery parameter on the authorize request, which skips the chooser and goes straight to that IdP. Leaving it unset keeps the existing chooser behavior — fully backward compatible.main.go: readOPENSHIFT_LOGIN_IDP, appendoauth2.SetAuthURLParam("idp", idp)toAuthCodeOptionswhen setREADME.md: document the new env var next toOPENSHIFT_LOGIN_LOGLEVEL, with an example kubeconfig entryTest plan
go build/go vet/gofmt -lcleanhttps://claude.ai/code/session_012VuiD96S6BWQDNCbrKxzM2