question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ApiManagement SDK v8.1.1 unable to get access token with @azure/identity library

See original GitHub issue
  • Package Name: @azure/arm-apimanagement
  • Package Version: 8.1.1
  • Operating system: whatever
  • [ X] nodejs
    • version: 16.14.2
  • browser
    • name/version:
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug After switching from version 8.0.1 to version 8.1.1, the library is unable to get an access token using the @azure/identity library (version 3.0.0).

To Reproduce const apimClient = new ApiManagementClient( new DefaultAzureCredential(), <subscriptionId> ) apimClient.user.listByService(<rgName>, <serviceName>).next() This throw the following error: AuthenticationError: EnvironmentCredential authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot. Status code: 400 More details: invalid_scope: 1002012 - [2022-10-04 12:28:20Z]: AADSTS1002012: The provided value for scope undefined is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI). It seems that @azure/arm-apimanagement calls getToken method of @azure/identity without setting the scope parameter.

This was work fine with version 8.0.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jeremymengcommented, Oct 5, 2022

It may be better if we don’t have to specify this when running on public clouds as options.credentialScopes is optional.

0reactions
patrickdassiercommented, Oct 10, 2022

@qiaozha : I confirm that release 8.1.2 fix the issue. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use the Azure Identity library to get an access token for ...
The Azure Identity client library reads values from three environment variables at runtime to authenticate the service principal. The following ...
Read more >
client credential flows must have a scope value with /.default ...
RuntimeException : Unable to get access token at com.eclerx.email.AccessProvider.accessToken(AccessProvider.java:30) at com.eclerx.email.
Read more >
@azure/identity - npm
Provides credential implementations for Azure SDK libraries that can authenticate with Azure Active Directory. Latest version: 3.1.2, ...
Read more >
Azure Identity client library for .NET
The Azure Identity library provides Azure Active Directory token authentication support across the Azure SDK. It provides a set of TokenCredential ...
Read more >
ApiManagement SDK v8.1.1 unable to get access token with ...
Azure/azure-sdk-for-js: ApiManagement SDK v8.1.1 unable to get access token with @azure/identity library.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found