in alloydb-jdbc-connector/src/main/java/com/google/cloud/alloydb/DefaultAccessTokenSupplier.java [47:71]
public String getTokenValue() throws IOException {
try {
if (credentialFactory == null) {
return null;
}
final GoogleCredentials credentials = credentialFactory.getCredentials();
try {
credentials.refreshIfExpired();
} catch (IllegalStateException e) {
throw new IllegalStateException("Error refreshing credentials " + credentials, e);
}
if (credentials.getAccessToken() == null
|| "".equals(credentials.getAccessToken().getTokenValue())) {
String errorMessage = "Access Token has length of zero";
throw new IllegalStateException(errorMessage);
}
validateAccessTokenExpiration(credentials.getAccessToken());
return credentials.getAccessToken().getTokenValue();
} catch (IOException e) {
throw e;
}
}