-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve Doc phrasing for DefaultAzureCredential.GetToken #11343
Comments
tagging as /cc @jianghaolu who is looking at this now for Java (we'll want to make this consistent across all 4 languages) |
Here are some specific suggestions by Scott: Azure/azure-sdk-for-net#13531 (comment) |
I'll make a PR with:
|
So, this is an interesting case, TypeScript doesn't have this method visible as part of the DefaultAzureCredential, since it's inherited. So, the DefaultAzureCredential code can be seen here: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/src/credentials/defaultAzureCredential.ts The The current documentation in the /**
* Returns the first access token returned by one of the chained
* `TokenCredential` implementations. Throws an {@link AggregateAuthenticationError}
* when one or more credentials throws an {@link AuthenticationError} and
* no credentials have returned an access token.
*
* @param scopes The list of scopes for which the token will have access.
* @param options The options used to configure any requests this
* `TokenCredential` implementation might make.
*/
async getToken( In the context of TypeScript, this makes perfect sense to me, so I wonder, should we still pursue this change? or should we close this issue? |
@sadasant that comment looks perfectly reasonable. The work item is to track getting all 4 languages in-sync on the xml doc comment as at least .NET (and python?) have comments that are unintentionally too scary and lead users down the wrong path in some cases. @jianghaolu can you share more? |
The comment we've agreed to change to is
@joshfree we currently also don't have the "scary comment" in Java either. We can either add this comment, or not do anything at all. |
@jianghaolu please add the new agreed upon doc comment to Java for consistency |
Tracking Work Item
The statement from the XML docs mentioned above, was meant to discourage people from calling GetTokenAsync directly in the most common case that they are using a client from Azure SDK which supports authenticating using a TokenCredential. Let's clarify the message as at least 2 users have been confused by the phrasing above.
Related Azure/azure-sdk-for-net#13531 and Azure/azure-sdk-for-python#13875 and Azure/azure-sdk-for-java#15369
The text was updated successfully, but these errors were encountered: