From 24422f59d4d9b71a0b5d03f27668b8bc415a0111 Mon Sep 17 00:00:00 2001 From: aeitzman <12433791+aeitzman@users.noreply.github.com> Date: Tue, 9 Apr 2024 16:05:19 -0700 Subject: [PATCH] Update oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java Co-authored-by: Leo <39062083+lsirac@users.noreply.github.com> --- .../com/google/auth/oauth2/ExternalAccountCredentials.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java b/oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java index 7162fda45..f3cf91a8a 100644 --- a/oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java +++ b/oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java @@ -236,16 +236,16 @@ protected ExternalAccountCredentials(ExternalAccountCredentials.Builder builder) this.clientId = builder.clientId; this.clientSecret = builder.clientSecret; - if (builder.tokenUrl == null) { + this.tokenUrl = builder.tokenUrl; + if (this.tokenUrl == null) { try { this.tokenUrl = DEFAULT_TOKEN_URL.replace("{UNIVERSE_DOMAIN}", this.getUniverseDomain()); } catch (IOException e) { // Throwing an IOException would be a breaking change, so wrap it here. + // This should not happen for this credential type. throw new IllegalStateException( "Error occurred when attempting to retrieve universe domain.", e); } - } else { - this.tokenUrl = builder.tokenUrl; } this.scopes =