Update global vars after updating obj

Update the global vars so that secretAccessKey and accessKeyId are updated after metadata.readCredentials