Open hjarraya opened 2 months ago
I have the same problem. This is occurring on 0.20.0
and did not occur with the previous version of the library: 0.19.0
.
Looks like the federated token (e.g. Kubernetes SA projected token) is only loaded once since 0.20.0
.
0.19.0
EnvironmentCredential
loaded it every time so it just worked back then:
let token = std::fs::read_to_string(file.clone())
.with_context(ErrorKind::Credential, || {
format!("failed to read federated token from file {}", file.as_str())
})?;
let mut credential: WorkloadIdentityCredential = WorkloadIdentityCredential::new(
self.http_client.clone(),
tenant_id,
client_id,
token,
);
credential.set_options(options);
return credential.get_token(scopes).await;
Indeed, it is loaded every time, so I cached it locally and requested it when it was about to expire.
We are running Azure Identity v0.20.0 and getting this error for a longer-running process in AKS. We are using Workload Identity with our deployments.
The workload identity token is not being refreshed as it is supposed to be.