-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
The documentation for the TokenCredential is non-existent #20221
Comments
Hi @leidegre. Thank you for your feedback and we regret that you're experiencing difficulties. Unfortunately, many of the details that you're interested in are controlled by the specific service performing authentication and aren't defined or controlled by the I'm going to route this over to the folks working on |
I was able to identify the following behavior with respect to token expiry, so it's 5 minutes in this case but this is important stuff, it's not like the different services performing authentication can do what they want. There's an intent in the abstraction which right now is just undocumented. I would expect there to be a little bit more context around why the various abstractions exist and what problems they aim to solve and what assumptions you can make about them. Abstractions that don't allow you to make any assumptions are not helpful so I'm sure there's a lot of details here that just left out for some reason. Moreover, I often consult the source code and I'm surprise at how little comments/documentation there is. It's difficult to gauge what the intent is behind all these designs when there's so little to go on. |
Hi @leidegre - The behavior details of how the token is created and its expiration is mostly controlled by the authority, which in this case is usually Azure Active Directory. Is there more context you could provide about what problem you are trying to solve? |
@christothes My point was just that it would be helpful if the documentation would be more extensive regarding the token you get back from the For example, When you call See, the abstraction has changed the guarantees that I have about the token expiry but this is undocumented behavior. I have some additional information in this comment, if you wanna take a look. |
Hi @leidegre - Could you clarify where you are seeing this statement of behavior guarantees? The |
@christothes ok, please read carefully. I believe I have been misunderstood twice now. This has absolutely nothing to do with the AAD infrastructure. The problem is that the different implementations of If you allowed yourself to cache the token longer, clock skew between services could cause the token to fail validation. Not because it was invalid but because it's expiry cannot be determined with the precision of an atomic clock. In my previous comment I included a screenshot of what happens if you sample the Neither the |
Also, we're considering library updates to provide some indication in the API as to whether a particular credential will handle caching for you, and possibly configure the behavior of that caching. However, we haven't committed to these additions yet, and it's not clear that this would apply to all credentials in the Azure.Identity library. |
I don't like being surprised. It was surprising to me that the 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 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! |
No problem. One thing to add though - as of version 1.4.0.beta-4, the |
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 theAzure.Identity
package), I like to know what I can expect from the token I get back. It doesn't say that theExpiresOn
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.
The text was updated successfully, but these errors were encountered: