janus-idp / backstage-showcase

Enterprise-ready Backstage distribution

Home Page:https://showcase.janus-idp.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple Auth Providers can be registered simultaneously

Zaperex opened this issue · comments

Describe the bug

Currently, the conditional sign-in page renders the sign-in page for the auth provider in the signInPage field of the app configurations.

However, if the user has more than one auth provider configured, and then are able to successfully authenticate with the auth provider in the signInPage, they'll then be able to attempt to sign in with the auth providers in the settings menu authentication providers tab since all the auth providers in the configurations are registered regardless of the signInPage configurations.
Auth Provider Tab with a bunch of auth providers

Expected Behavior

Only the auth provider in the signInPage configuration should be registered to prevent users from authenticating to the other auth providers.

What are the steps to reproduce this bug?

  1. In the app configurations auth field, provide configurations for 2 auth providers (at least one needs to be valid) and put one of them as the signInPage
auth:
  environment: development
  providers:
    gitlab:
      development:
        clientId: ${GITHUB_CLIENT_ID}
        clientSecret: ${GITHUB_CLIENT_SECRET}
    github:
      development:
        clientId: ${GITLAB_CLIENT_ID}
        clientSecret: ${GITLAB_CLIENT_SECRET}
signInPage: github
  1. Sign in to the configured auth provider (in the example above, github is used)
  2. Navigate to the Settings -> Authentication Providers
  3. Observe that the gitlab auth provider is also registered

Versions of software used and environment

This shouldn't pose any big issues, but these additional sign-in auth providers don't seem to do anything since they don't modify the backstage identity at all, so it doesn't make sense to have them registered.

Reopen if needed.