[BUG] AzureCliCredential improperly parses expiresOn returned from 'az account get-access-token' #15801
Labels
Azure.Identity
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Client
This issue points to a problem in the data-plane of the library.
Milestone
The the value of the "expiresOn" feild returned from
az account get-access-token
is a local time with no timezone information, for example "2020-10-07 09:53:24.773201". However, when we parse we use theAdjustToUniversal
date time styleazure-sdk-for-net/sdk/identity/Azure.Identity/src/AzureCliCredential.cs
Line 174 in db3c89b
According to the documentation
AdjustToUniversal
will result in aDateTimeOffset
withKind
== Unspecified if no timezone is included in the string unless theAssumeLocal
flag is also specified, so it can be adjusted to UTC.The code should be updated to pass both flags
DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeLocal
.The text was updated successfully, but these errors were encountered: