OpenFn / OpenFn/lightning

Remove the oauth2 hex package and the legacy auth_providers modules

Open
#4,723 0 comments 0 reactions 1 assignee View on GitHub

@doc-han is already working on this.

Since Jun 4, 2026.

Full SSO Experience
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

The oauth2 hex package is only used today by an older OIDC login implementation under lib/lightning/auth_providers/. The credential OAuth flow has been on Tesla (via OauthHTTPClient) for a while. This ticket retires the package once the audit in #4702 confirms no one's using the per-instance OIDC login in production.

What to remove

  • The oauth2 dependency in mix.exs.
  • Lightning.AuthProviders.Handler, Common, Google, Salesforce, OAuthBehaviour. The last three already have zero callers in lib/ or test/.
  • The cache pieces (Store, CacheWarmer) that warm a single row from the auth_providers table.
  • The auth_providers DB table.
  • The login portion of LightningWeb.OidcController (the show/2 action and the first clause of new/2), the auth_handler_url/0 button on /users/log_in, and the admin LiveView at /settings/authentication.

What to keep

The other two clauses of OidcController.new/2 handle the popup callback for the credential OAuth flow at /authenticate/callback. They're alive and OauthHTTPClient depends on them. Move them to a clearer module before deleting OidcController.

Order

  1. Land #4702's audit answer.
  2. Move the popup clauses to a new controller, update RouteHelpers.oidc_callback_url/0.
  3. Delete the legacy modules, drop the table.
  4. Remove the oauth2 dep.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.