[FEATURE REQ] Make it so the KeyVaultCredentialPolicy makes a call to obtain an authentication challenge only in the case there is no access token in the cache or it has expired #10381
Labels
Client
This issue points to a problem in the data-plane of the library.
feature-request
This issue requires a new behavior in the product in order be resolved.
KeyVault
pillar-performance
The issue is related to performance, one of our core engineering pillars.
Milestone
Is your feature request related to a problem? Please describe.
When authenticating calls for KeyVault Keys, the Java KeyVaultCredentialPolicy class always makes a naive call to obtain a challenge that could be used to get an access token in case there is none in the cache or the one it has is expired.
Describe the solution you'd like
The KeyVaultCredentialPolicy only makes a call for a challenge AFTER making sure there is no token in the cache or if it has expired.
Describe alternatives you've considered
Caching the challenge like the .NET SDK does and using that instead in case there is no token or it has expired.
Information Checklist
The text was updated successfully, but these errors were encountered: