-
Notifications
You must be signed in to change notification settings - Fork 154
az cli returns expiresOn in local time but sdk assumes c++ time #5075
Copy link
Copy link
Labels
Azure.IdentityClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team
Metadata
Metadata
Assignees
Labels
Azure.IdentityClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team
Type
Projects
Status
Done
Describe the bug
When using an AzureCliCredential, the
ExpiresOnfield is parsed from the the output of the callwhich returns the field
expiresOnin local time but does not add time zone information. However,Azure::DateTimeassumes - when no time zone information is present - that the date is in UTC.The
IsFreshmethod of Azure::TokenCache then compares the parsedExpiresOnwithAzure::DateTime(std::chrono::system_clock::now())which is UTC time thus yielding a wrong comparison.Exception or Stack Trace
To Reproduce
Steps to reproduce the behavior:
Inject the following debug code in
TokenCache::IsFreshintoken_cache.cpp:Then call any api using the
AzureCliCredentialthat requires a token.Code Snippet
Expected behavior
The AzureCliCredential should correctly take the time zone information into account.
Screenshots
Setup (please complete the following information):
1.6.0-beta.1and Azure Core1.10.2Additional context
Add any other context about the problem here.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report