[identity] Token expired from managed identity seems to never be refreshed
See original GitHub issue- Package Name: @azure/identity
- Package Version: 3.1.1
- Operating system: Windows
- nodejs
- version: 14.20.0
Describe the bug Since the switch to version 3.1.1 of the library we notice that after about 24 hours it is no longer possible to retrieve information on a KeyVault, App Config, … The error received is that the token has expired as if it was never refresh. For example, we use the ApiManagementClient to communicate with the APIM. When we make a call to list the users registered on the instance we get this error (only after 24 hours without restarting the process): "The access token expiry UTC time ‘12/1/2022 4:31:31 PM’ is earlier than current UTC time ‘12/1/2022 5:13:12 PM’.
this.client = new ApiManagementClient(
new DefaultAzureCredential(),
this._subscriptionId,
{ credentialScopes: 'https://management.azure.com/.default' }
)
// 24 hours later
this.client.user.listByService(<resourceGroupName>, <apimName>)
This problem seems to only happen on App Services where we use man
Expected behavior The token should be refreshed automatically to avoid expired token
Additional context After some further research we noticed a change that was made in version 3.1.1 of the library in data returned when retrieving token from managed identity credentials : https://github.com/Azure/azure-sdk-for-js/pull/23920/files
Issue Analytics
- State:
- Created 10 months ago
- Comments:12 (5 by maintainers)
I can also confirm. Since 2 days of usage of 3.1.2 no more expired token
@KarishmaGhiya : After one day and a half of test, I can confirm that the issue is solved. Thanks