@SneakyThrows
    private synchronized Credentials getTemporaryCredentials() {
        Date date = Date.from(Instant.ofEpochMilli(clock.getAsLong() + EXPIRATION_WINDOW_IN_MS));
        if (accessToken == null || date.after(accessToken.getExpirationTime())) {
            accessToken = googleCredentials.refreshAccessToken();
        }
        return new Credentials("", accessToken.getTokenValue());
    }
@param identity client email address
@param credential could be private key or path to JSON file where the private resides
storage/src/main/java/com/epam/aidial/core/storage/blobstore/credential/GcpCredentialProvider.java