Hi @ KristfNalesnyik-1870
TokenCredential is the interface for all the credential classes that provide the token.
If you are using GetToken() or GetTokenAync() method directly to get access token , then token caching and token refreshing is not supported by defaultAzureCredential. This need to be handle by caller in this case.
Reference - https://learn.microsoft.com/en-us/java/api/com.azure.core.credential.tokencredential?view=azure-java-stable
However, You can use BearerTokenAuthenticationPolicy to cache TokenCredential using HttpPipeline Policy.
or You can use MSAL library in place of Azure Identity that can get access token using Managed identity and manage caching and refresh token.