You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This approach is universal and eliminates all necessary complexity.
Proposal
There are possible approaches:
Make a BREAKING CHANGE to convert the expiresOn in the output of az account get-access-token to an integer representing the epoch time. This can be done during MSAL migration: ADAL to MSAL migration #18944
Introduce another property expires_on. This will not be a BREAKING CHANGE, but introduces naming inconsistency as other properties uses camelCase, but expires_on is snake_case.
Introduce another properties like expiresOnEpoch, but naming like this is non-conventional.
Context
Currently, the
expiresOnproperty in the output ofaz account get-access-tokenis a string representing the local time:This inherits from the ADAL behavior: https://github.com/AzureAD/azure-activedirectory-library-for-python/blob/35f9e003bed47936a1df3c6eb696691dc1fa91c3/adal/oauth2_client.py#L187
This causes various time computation problems and difficulties, especially for daylight saving time, such as
Other tools or services are already using an integer to represent the epoch time:
expires_on: https://github.com/Azure/azure-sdk-for-python/blob/844e16db0abc553ab1adf104128cbf0e223af189/sdk/core/azure-core/azure/core/credentials.py#L14expires_on: https://github.com/AzureAD/microsoft-authentication-library-for-python/blob/db6f001060e0adcc1edccac1a86ec05bd59f15f0/msal/token_cache.py#L176expires_on:azure-cli/src/azure-cli-core/azure/cli/core/adal_authentication.py
Line 116 in 14cc787
This approach is universal and eliminates all necessary complexity.
Proposal
There are possible approaches:
expiresOnin the output ofaz account get-access-tokento an integer representing the epoch time. This can be done during MSAL migration: ADAL to MSAL migration #18944expires_on. This will not be a BREAKING CHANGE, but introduces naming inconsistency as other properties uses camelCase, butexpires_onis snake_case.expiresOnEpoch, but naming like this is non-conventional.