The documentation for the TokenCredential is non-existent
See original GitHub issueIt’s quite typical that the MSDN documentation is just regurgitating what is obvious from the type information that’s already present. Such documentation doesn’t add any value and there’s no point in adding it. Rather, I’d like to know stuff that is not obvious from the type information alone.
For example, in this case, with respect to the TokenCredential
(from the Azure.Identity
package), I like to know what I can expect from the token I get back. It doesn’t say that the ExpiresOn
property of the access token has some tolerance but it must have otherwise this API would create subtle race errors where the token you get back from the API expires before you have a chance to use it.
For example, I really need to know if the token is valid for at least 1 minute, or 5 minutes or 10 minutes? Which one is it and why? None of this is documented anywhere and it’s a problem because I cannot conclude what will happen when I use this API in these circumstances. I’m currently testing this through experimentation but I think it would be better if you used the documentation to explain in more detail what problem each API is meant to solve, and what you may expect from the APIs (i.e. what promises do you give?). Without this it’s hard to know if you’ve implemented the right thing or not and what additional issues you may need to take into account.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 730e71e9-4906-56f8-0a7c-a98d34ff05a9
- Version Independent ID: d39d4416-5993-458d-205c-5bacf669afb7
- Content: TokenCredential.GetTokenAsync(TokenRequestContext, CancellationToken) Method (Azure.Core) - Azure for .NET Developers
- Content Source: xml/Azure.Core/TokenCredential.xml
- Service: azure
- GitHub Login: @CamSoper
- Microsoft Alias: casoper
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
No problem. One thing to add though - as of version 1.4.0.beta-4, the
SharedTokenCacheCredential
is disabled by default.https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/identity/Azure.Identity/CHANGELOG.md#breaking-changes-1
I don’t like being surprised.
It was surprising to me that the
SharedTokenCacheCredential
(which does caching) was included in theDefaultAzureCredential
chain.I just want the ability to be able to formulate a valid theory on what will happen when I use these APIs, for that to be possible the surprising stuff needs to be taken out of the default path.
Not clear to me why the
SharedTokenCacheCredential
is included by default.I appreciate you taking the time. I think I’ve said all I can say. ❤️
If you wanna keep the issue open for some tracking purpose please do, otherwise close away!