Skip to content

Commit

Permalink
Hacky Credentials Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian committed Aug 9, 2018
1 parent f32c76f commit a07909a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions google-cloud-clients/google-cloud-firestore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</properties>
<dependencies>
<dependency>
<version>1.38.1-SNAPSHOT</version>
<groupId>${project.groupId}</groupId>
<artifactId>google-cloud-core</artifactId>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ public Builder setTimestampsInSnapshotsEnabled(boolean value) {
@Override
@Nonnull
public FirestoreOptions build() {
if (this.credentials == null && this.credentialsProvider != null) {
try {
this.setCredentials(credentialsProvider.getCredentials());
} catch (IOException e) {
throw new RuntimeException("Failed to obtain credentials", e);
}
}

return new FirestoreOptions(this);
}
}
Expand Down

0 comments on commit a07909a

Please sign in to comment.