Add IDP_HINT support for one-click IdP login - #8
Open
thusser wants to merge 1 commit into
Open
Conversation
- KeycloakSettings.idp_hint, read from PYOBS_AUTH['IDP_HINT'] - start_authorization(idp_hint=...) adds kc_idp_hint to the authorization URL, skipping Keycloak's login/IdP-selection page - LoginView: ?idp_hint= query param with the configured hint as default; present-but-empty suppresses the hint (local Keycloak account path) - Tests for client and views (override_settings-based), README docs - Version bump to 2.0.0.dev8
This was referenced Aug 22, 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.
Implements section 1 of
specs/plans/2026-08-21-keycloak-idp-hint-login.md(pyobs-core): one-click IdP login via Keycloak'skc_idp_hintparameter.Changes
KeycloakSettings.idp_hint, read fromPYOBS_AUTH['IDP_HINT'](optional, deployment-specific alias, e.g.gwdg).KeycloakClient.start_authorization(idp_hint=...)addskc_idp_hintto the authorization URL, so Keycloak skips its login/IdP-selection page and redirects straight to that IdP. Unknown aliases fall back to the normal login page. Backward compatible — new optional kwarg.LoginViewresolves the hint from the?idp_hint=query param with the configuredIDP_HINTas default, giving three cases: absent → settings default (fast path); present-but-empty → no hint (local Keycloak account);?idp_hint=<alias>→ that specific hint.nexthandling unchanged.tests/test_client.py(param present/absent), 3 intests/test_views.py(default, suppressed via?idp_hint=, explicit override) using per-testoverride_settingsas the plan requires. Full suite: 43 passed.ruff/blackclean.IDP_HINTand the?idp_hint=override.Version / release
Bumped to
2.0.0.dev8. Publishing is the usual tag push (v2.0.0.dev8) which triggers thepypi.ymlworkflow — do that after this merges so the consuming services (pyobs-archive / pyobs-robotic-backend / pyobs-web-admin, which pinpyobs-auth>=2.0.0.dev8in their PRs) can resolve the new version.