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

🐛 Bug Report: plugins/user-settings with default auth provider settings shouldn't render providers that are irrelevant to the current environment #27531

Open
2 tasks done
cecobask opened this issue Nov 6, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@cecobask
Copy link

cecobask commented Nov 6, 2024

📜 Description

The plugin user-settings with default auth provider settings shouldn't render providers that are irrelevant to the current environment.

Config file:

auth:
  environment: development
  providers:
    guest:
      development: {}

Environment variables:

APP_CONFIG_auth_providers_okta_staging_clientId=<REDACTED>
APP_CONFIG_auth_providers_okta_staging_clientSecret=<REDACTED>

👍 Expected behavior

Configured providers:

  • guest

👎 Actual Behavior with Screenshots

Configured providers:

  • guest
  • okta

👟 Reproduction steps

Steps to reproduce are described above - use the provided configuration to run backstage.

📃 Provide the context for the Bug.

Affected plugin: https://github.com/backstage/backstage/tree/master/plugins/user-settings

🖥️ Your Environment

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

@cecobask cecobask added the bug Something isn't working label Nov 6, 2024
@cecobask cecobask changed the title 🐛 Bug Report: plugin user-settings shouldn't display auth providers that aren't enabled in the current environment 🐛 Bug Report: plugins/user-settings with default auth provider settings shouldn't render providers that are irrelevant to the current environment Nov 6, 2024
@jhaals
Copy link
Member

jhaals commented Nov 11, 2024

Hey @cecobask, thanks for the report!
I think the best thing to do is to make the user-settings plugin ask the auth-backend which providers are actually installed instead of trying to parse the configuration file as those can differ especially in split deployment scenarios.

@cecobask
Copy link
Author

Hi @jhaals, I agree with the suggested approach. Can I take a stab at this?

@vinzscam
Copy link
Member

assigned to you @cecobask! Thanks for looking into it 🙏

@cecobask
Copy link
Author

Thanks! I'm a newbie here and was having trouble figuring out how to request this information from the auth-backend.
Could you provide an example of a plugin that communicates with the auth-backend and I will take it from there?

@vinzscam
Copy link
Member

Sorry @cecobask, we took a closer look, and at the moment it seems this would be tricky to achieve because the auth-backend knows the providers, but it doesn't know which environments each provider supports.

@cecobask
Copy link
Author

From my investigation, accessing the configuration from the frontend app is not helpful either.
It only has visibility of the auth providers list, but not its nested properties, which is where the auth envs are stored.
I will be happy to help, just need a little bit of guidance on understanding how it can be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants