Skip to content

Docs for DefaultAzureCredential.get_token #13875

@noelbundick

Description

@noelbundick

The get_token docs for DefaultAzureCredential (as well as all other credential classes) have a prominent callout that reads This method is called by Azure SDK clients. It isn't intended for use in application code.

This is mostly true when working exclusively with Azure SDK clients, but is very misleading for developers who need to use the credential objects to obtain tokens for other scenarios. A dev on my team just burned a day because he thought that we shouldn't be using DefaultAzureCredential in our codebase to auth from our CLI -> API

Some examples of valid usage that the current docs discourage:

  • Obtaining an AAD token for authentication against Azure SQL
  • Using an AAD token to authenticate against your own services configured w/ OAuth2

The Java and JS libraries do not contain this warning. There is a corresponding issue in the .NET repo slated for 2020 October here: Azure/azure-sdk-for-net#13531

Can we please remove this warning and/or align with the other languages to make its true intent more clear?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions