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.

The documentation for the TokenCredential is non-existent

See original GitHub issue

It’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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
christothescommented, Apr 14, 2021

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

0reactions
leidegrecommented, Apr 14, 2021

I don’t like being surprised.

It was surprising to me that the SharedTokenCacheCredential (which does caching) was included in the DefaultAzureCredential 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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

DefaultAzureCredential().GetTokenAsync fails when using ...
I've created two Azure App Service webapps (which are ASP.NET Core Web API projects) - one acting as the client and the other...
Read more >
DefaultAzureCredential Class (Azure.Identity)
Provides a default TokenCredential authentication flow for applications that will be deployed to Azure. The following credential types if enabled will be ...
Read more >
Source code for azure.eventhub._client_base - Microsoft .NET
Built with Sphinx using a theme provided by Read the Docs.
Read more >
Azure.Core 1.21.0
Azure.Core provides shared primitives, abstractions, and helpers for modern .NET Azure SDK client libraries. These libraries follow the Azure ...
Read more >
TokenCredential (Azure SDK for Java Reference ...
Asynchronously get a token for a given resource/audience. Parameters: request - the details of the token request; Returns: a Publisher that emits a ......
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