-
Notifications
You must be signed in to change notification settings - Fork 126
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
AzureCliCredential: add support for expires_on
field.
#5180
Conversation
Let's wait on this until we have a conclusion on Az Cli version support. |
sdk/identity/azure-identity/test/ut/token_credential_impl_test.cpp
Outdated
Show resolved
Hide resolved
sdk/identity/azure-identity/test/ut/token_credential_impl_test.cpp
Outdated
Show resolved
Hide resolved
sdk/identity/azure-identity/test/ut/azure_cli_credential_test.cpp
Outdated
Show resolved
Hide resolved
Sure. |
I discussed this today and shared the conclusion on the issue: The other languages don't have the DST concern, let's discuss that separately. It does seem like that's an OK trade-off given where C++ language support is, and given AzureCliCredential is a dev time credential anyway. |
sdk/identity/azure-identity/test/ut/azure_cli_credential_test.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, LGTM.
Closes #5116.
It works the following way - if
expires_on
(the new one) property is present, it gets parsed beforeExpiresOn
(the old one) property.This PR is not a replacement for #5179, which mitigates the issue if the user has older version of Azure CLI installed. We can't expect users to always have the latest installed. The one without time zone info has been there first, for many years, and only now they are adding the
expires_on
property.#5179 is good enough, but not ideal - once a year, one day in fall, when it is close to moving from DST, the token will be off for one hour, and then everything should work, but an extra token request will be sent when the auth policy will supply a token which was obtained when the DST was on, but the service will reject it, and then the policy will tell the credential to get a new token, and everything will work once again.
And one day in spring, when the clock moves to DST, the tokens obtained will have 1 hour shorter expiration than what they actually are, and some extra requests to refresh tokens will be made.
--
UWP CI is currently blocked until microsoft/vcpkg#35279 is fixed / microsoft/vcpkg#35116 is merged (#5181 would unblock)