Skip to content

Add IDP_HINT support for one-click IdP login - #8

Open
thusser wants to merge 1 commit into
developfrom
feat/idp-hint-login
Open

Add IDP_HINT support for one-click IdP login#8
thusser wants to merge 1 commit into
developfrom
feat/idp-hint-login

Conversation

@thusser

@thusser thusser commented Aug 22, 2026

Copy link
Copy Markdown
Member

Implements section 1 of specs/plans/2026-08-21-keycloak-idp-hint-login.md (pyobs-core): one-click IdP login via Keycloak's kc_idp_hint parameter.

Changes

  • KeycloakSettings.idp_hint, read from PYOBS_AUTH['IDP_HINT'] (optional, deployment-specific alias, e.g. gwdg).
  • KeycloakClient.start_authorization(idp_hint=...) adds kc_idp_hint to 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.
  • LoginView resolves the hint from the ?idp_hint= query param with the configured IDP_HINT as default, giving three cases: absent → settings default (fast path); present-but-empty → no hint (local Keycloak account); ?idp_hint=<alias> → that specific hint. next handling unchanged.
  • Tests: 2 in tests/test_client.py (param present/absent), 3 in tests/test_views.py (default, suppressed via ?idp_hint=, explicit override) using per-test override_settings as the plan requires. Full suite: 43 passed. ruff/black clean.
  • README documents IDP_HINT and the ?idp_hint= override.

Version / release

Bumped to 2.0.0.dev8. Publishing is the usual tag push (v2.0.0.dev8) which triggers the pypi.yml workflow — do that after this merges so the consuming services (pyobs-archive / pyobs-robotic-backend / pyobs-web-admin, which pin pyobs-auth>=2.0.0.dev8 in their PRs) can resolve the new version.

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant