https://github.com/IBM/ruby-sdk-core/blob/9f94b77921daa2212f0d38efba1b3ca91dfc6e28/lib/ibm_cloud_sdk_core/authenticators/iam_authenticator.rb#L39C59-L39C71
It looks like the problem is in this section here: but it could be resolved in other places
def authenticate(headers)
headers["Authorization"] = "Bearer #{@token_manager.access_token}"
end
Instead of @token_manager.access_token it could simply call @token_manager.token falling back on the JWT manager's code to check the expiration time of the token and get a new one if required.
For now, I have monkey patched the class to make an attr_acessor for the token manager from the authenticator so that I can call token manually before using the authenticator