We have an on-prem Temporal cluster with the below configuration for Authentication.
authorization:
authorizer: default
claimMapper: default
permissionsClaimName: roles
jwtKeyProvider:
keySourceURIs:
- https://login.microsoftonline.com/{azure_tenant_id}/discovery/v2.0/keys
It looks like Temporal caches the RSA keys returned from "keySourceURIs".
Since we are using Azure AD as IdP, it rotates the keys in the background without our knowledge and our Workflows fail with an Authentication error "PERMISSION_DENIED: Request unauthorized.".
I want to know if there is any way to make Temporal aware of the key rotation.
There is a refresh interval here in their helm chart that reads from the environment variable
TEMPORAL_JWT_KEY_REFRESH
.There is a recent documentation bogpost, that is using it as below
While examining the Golang code responsible for managing the configuration:
I have concerns about the key no longer being updated. I would recommend opening an issue regarding this matter. Actually I've just opened #5127
But the callback should periodically refresh the key
Regarding the question about whether the URI
will keep working after a key rotation, the answer is supposed to be yes. The purpose of the JWKS endpoint is to provide a set of public keys that can be used to verify the authenticity of tokens. As long as the endpoint continues to provide the current set of keys, Temporal token validation should remain functional, even after key rotation.
So I will close the above issue as soos as it is confirmed to work as expected.