Skip to content

Refactor Auth module to allow multiple auth strategies #6

@jescalada

Description

@jescalada

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;
};

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions