Skip to content

🐛 Bug Report: Entra ID Consent for Azure DevOps Shows Error, despite then working #27432

@sam-cogan

Description

@sam-cogan

📜 Description

I'm using Entra ID authentication into backstage, with users auto-populated in the catalog from Entra, and this is all working fine. I am no creating a software template that uses the Git Repo picker and I want it to get a token for Azure DevOps. I have configured the Git Repo picker with the requestUserCredentials option.

When a user first attempts to use this, they are presented with an Entra ID consent page for permission to Azure DevOps, the user consents and then is returned to Backstage where they get an error stating "Login failed, user profile does not contain an email". However, if the user then dismisses the error, everything works and backstage can access ADO as that user.

I have also tried changing the resolver to emailMatchingUserEntityAnnotation and it then complains that Microsoft profile contained no email. I have checked the user entity in Backstage and can see all the appropriate annotations are correct so my only guess at this point is that what comes back from Entra is missing something, but I'm not in control of that, and it doesn't seem to matter anyway, as it all works.

👍 Expected behavior

User should not get any error when completing consent to ADO, given that the access actually works.

👎 Actual Behavior with Screenshots

image

image

👟 Reproduction steps

  1. Configure a git repo picker to obtain the user secret, and configure it to use dev.azure.com as the domain
  2. Attempt to use Git repo picker and get presented with a window indicating login to Microsoft is required
  3. Complete consent to allow access to Azure DevOps
  4. Get error message
  5. Dismiss error and see that all is working as expected

📃 Provide the context for the Bug.

I'm trying to allow the user to perform software template operations using their own ADO credentials.

🖥️ Your Environment

Running locally in docker, and in Azure App Service, both experience the same issue

👀 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?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:coreRelated to the Core Backstage Frameworkstaletype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions