Skip to content

9357 idp-seam-integration - #6681

Open
ttoomey wants to merge 15 commits into
mainfrom
9357-idp-seam-integration
Open

9357 idp-seam-integration#6681
ttoomey wants to merge 15 commits into
mainfrom
9357-idp-seam-integration

Conversation

@ttoomey

@ttoomey ttoomey commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Merging this PR

  • use a merge-commit or rebase strategy for PRs targeting staging and production

Description

IDP seams integration, see linked issue

ttoomey added 2 commits July 3, 2026 03:52
Add JWT authentication for warehouse request layer

Support AUTH_METHOD=jwt as an alternative to the default Devise/Warden
flow, covering requests, ActionCable, and rack-attack. HMIS wiring is
a follow-up PR.

- Extract Devise/Warden logic into DeviseCurrentUser concern; add
  Idp::JwtCurrentUser as the JWT equivalent
- Deny deactivated users even with a valid JWT (403, not sign-in loop)
- Route Devise/Doorkeeper vs Idp::SessionsController by AuthMethod,
  preserving existing *_path helpers
- Authenticate ActionCable/rack-attack via Idp::JwtHelper and
  User.find_from_jwt under JWT mode
- Gate Devise/OmniAuth/AuthTrail initializers and sign-in UI behind
  AuthMethod.devise?; enable Keycloak under JWT
@ttoomey ttoomey changed the title Revert "Merge pull request #6676 from greenriver/staging-revert-2389e30" 9357 idp-seam-integration Jul 4, 2026
ttoomey added 3 commits July 8, 2026 19:15
Move the JWT authentication code into a shared concern so HMIS can use it too, instead of copying what the warehouse already has. HMIS still falls back to the existing Devise/Pretender auth when JWT is not the configured auth method, so this does not change behavior for anyone not using JWT.

Also fixes a couple of bugs: impersonation not saving correctly on the first request, and a sign-out redirect that was not checking the destination properly. Updates CI to run the new HMIS tests, and adds a check to stop the Keycloak migration scripts from running unless Devise is enabled, since they need Devise data to work.
# forged cross-site request triggering that is a forced-logout nuisance at worst, not a
# meaningful escalation - the actual credential (the oauth2-proxy/IdP session) is untouched
# here regardless and only ends when the browser follows the returned redirect_url.
skip_before_action :verify_authenticity_token, only: :destroy
eanders and others added 2 commits July 17, 2026 13:29
…6718)

Add a machine-to-machine endpoint (`/api/superset/user_roles`) to allow Superset to retrieve user roles when running in JWT mode

- Gate Doorkeeper initialization under the JWT
- Improve JWKS failure handling to fail closed and log exceptions 
- Update docs
include LogRagePayloadBehavior

# Token-authenticated, session-less API
skip_forgery_protection
ttoomey added 7 commits July 20, 2026 15:14
Establish direct links between user accounts and Keycloak without requiring initial user authentication.

- Add bulk keycloak user query
- Add a service to bulk-map confirmed active users to their IDP source
- Add a nightly job to trigger backfills for supported IDP service configs
- Provide a Rake task entry point for manual backfill execution
User account management/admin integration with IdP; behavior selected at boot time by AUTH_METHOD. The existing Devise behavior is unchanged.

The auth-agnostic bulk of the admin users controllers is extracted into shared concerns with template-method seams for the Devise-only pieces (2FA, IdP push), so the two arms stay aligned. Under the IdP arm, admins can create, deactivate/reactivate, and force password resets on accounts by pushing to Keycloak. Account provisioning links or creates the account in Keycloak and emails the user a setup link. Admin views are adapted, hiding or disabling actions that don't apply to a given IdP configuration.

Also extends the Keycloak service layer (lookup, disable, force-password-change, setup email) and centralizes IdP-vs-Devise capability checks on the user model. Adds specs for the new controllers, the account-creation flow, and regression coverage of the shared surfaces under both auth methods.
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.

3 participants