Skip to content

Commit 5e8d847

Browse files
Hacky Credentials Fix (#3541)
1 parent 982f1ba commit 5e8d847

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore

google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreOptions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ public Builder setTimestampsInSnapshotsEnabled(boolean value) {
208208
@Override
209209
@Nonnull
210210
public FirestoreOptions build() {
211+
if (this.credentials == null && this.credentialsProvider != null) {
212+
try {
213+
this.setCredentials(credentialsProvider.getCredentials());
214+
} catch (IOException e) {
215+
throw new RuntimeException("Failed to obtain credentials", e);
216+
}
217+
}
218+
211219
return new FirestoreOptions(this);
212220
}
213221
}

0 commit comments

Comments
 (0)