Refactor/migrate open id connector#2822
Merged
simonredfern merged 3 commits intoJun 2, 2026
Merged
Conversation
Port the OpenID Connect relying-party callback (/auth/openid-connect/callback
{,-1,-2}) from the Lift `serve {}` dispatch to a native http4s route in
Http4sOpenIdConnect, wired into Http4sApp.baseServices next to the other
non-API auth routes (DirectLoginRoutes / AliveCheckRoutes).
The callback was dead code on Lift (enableOpenIdConnectApis was never called,
so provider redirects 404'd); this makes it functional natively while keeping
the provider contract unchanged so OBP-OIDC and Keycloak work as-is:
- the three callback paths match GET and POST byte-for-byte;
- the token exchange (form-encoded POST to openid_connect_$n.endpoint.token,
reading the same openid_connect_$n.* props) and JWT validation against the
provider jwks_uri are ported verbatim;
- gating is read per request: openid_connect.enabled=false (default) makes the
route fall through (404, as before); allow_openid_connect=false returns 401.
Success path: instead of the now-vestigial Lift-session logUserIn + redirect
(the portal that consumed it was removed), mint a usable OBP DirectLogin token
via the new DirectLogin.issueTokenForUser and return 200 {"token": "..."}.
Details:
- Http4sOpenIdConnect: 3 routes + handle(); business logic (token exchange,
JWT validation, resource-user/auth-user/consumer provisioning, OIDC-token
persistence) and OpenIdConnectConfig moved verbatim from openidconnect.scala.
- DirectLogin.issueTokenForUser(userPrimaryKey, consumerKey): public helper
reusing the existing token minting (generateTokenAndSecret + Tokens.vend).
- OAuth2.scala: repoint OpenIdConnect.openIdConnect -> Http4sOpenIdConnect.openIdConnect.
- openidconnect.scala: Lift OpenIdConnect object commented out (kept for history).
- Boot.scala: drop the dead enableOpenIdConnectApis + its dispatch registration.
- Http4sOpenIdConnectRoutesTest: 5 scenarios (gating, session-state, token-exchange 401).
Full suite green (3019/3019).
…to refactor/migrateOpenIdConnector
|
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.



No description provided.