Skip to content

Refactor/migrate open id connector#2822

Merged
simonredfern merged 3 commits into
OpenBankProject:developfrom
hongwei1:refactor/migrateOpenIdConnector
Jun 2, 2026
Merged

Refactor/migrate open id connector#2822
simonredfern merged 3 commits into
OpenBankProject:developfrom
hongwei1:refactor/migrateOpenIdConnector

Conversation

@hongwei1
Copy link
Copy Markdown
Contributor

@hongwei1 hongwei1 commented Jun 1, 2026

No description provided.

hongwei1 added 3 commits May 28, 2026 23:06
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).
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 1, 2026

@simonredfern simonredfern merged commit b36dced into OpenBankProject:develop Jun 2, 2026
7 checks passed
@hongwei1 hongwei1 deleted the refactor/migrateOpenIdConnector branch June 3, 2026 12:00
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.

2 participants