Skip to content

[Bug] InteractiveBrowserCredential not failing in non-interactive environments #22752

@sinedied

Description

@sinedied
  • Package Name: @azure/identity
  • Package Version: 2.1.0
  • Operating system: MacOS 12.4
  • nodejs
    • version: 16.14.0
  • browser
    • name/version:
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug
When using InteractiveBrowserCredential in a non-UI or non-interactive environment (CI, GitHub Actions...) it's stuck waiting indefinitely for an interactive login. When using ChainedTokenCredential, I would expect it to fail and fall back to the next credentials method chained.

To Reproduce
Steps to reproduce the behavior:

  1. Set up an app to log in with something like this:
  const browserCredential = new InteractiveBrowserCredential({
    redirectUri: `http://localhost:31337`
  });
  1. Try to run the app in a Docker container, for example.

Expected behavior
InteractiveBrowserCredential fails because of non-UI or non-interactive environment.

Additional context
Because of this issue, in SWA CLI (https://github.com/Azure/static-web-apps) the app never fall back to using DeviceTokenCredential in non-UI environment or gets CI stuck indefinitely in non-interactive environments.

Metadata

Metadata

Assignees

Labels

Azure.IdentityClientThis issue points to a problem in the data-plane of the library.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions