Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Auth module to allow multiple auth strategies #6

Closed
jescalada opened this issue Jan 29, 2025 · 0 comments · May be fixed by finos/git-proxy#963
Closed

Refactor Auth module to allow multiple auth strategies #6

jescalada opened this issue Jan 29, 2025 · 0 comments · May be fixed by finos/git-proxy#963
Assignees

Comments

@jescalada
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
To make things more flexible, we want to allow multiple auth strategies to be loaded dynamically when the user logs in rather than swapping it based on the proxy.config.json when starting the backend.

Right now, each entry in the auth config has an enabled flag that activates a single auth strategy in the switch found in src/service/passport.

Describe the solution you'd like
Load ALL the strategies that have a valid configuration, then connect it to the frontend so that users can choose an option.

Describe alternatives you've considered
Since we want to add OIDC (#1), I thought about hard-coding an OIDC option to the list. However, this is a bit too rigid since we want to allow users to log in using whatever they have available.

Additional context
This is how the passport is being configured right now src/service/passport:

const configure = async () => {
  const type = authenticationConfig.type.toLowerCase();

  switch (type) {
    case 'activedirectory':
      _passport = await activeDirectory.configure();
      break;
    case 'local':
      _passport = await local.configure();
      break;
    case 'openidconnect':
      _passport = await oidc.configure();
      break;
    default:
      throw Error(`uknown authentication type ${type}`);
  }
  _passport.type = authenticationConfig.type;
  return _passport;
};
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 a pull request may close this issue.

2 participants