diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreOptions.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreOptions.java index 0d91ee0764fa..bd095d62b5fe 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreOptions.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreOptions.java @@ -98,7 +98,11 @@ public String getDatabaseId() { } public CredentialsProvider getCredentialsProvider() { - return credentialsProvider; + if (credentials != null) { + return GrpcTransportOptions.setUpCredentialsProvider(this); + } else { + return credentialsProvider; + } } public TransportChannelProvider getTransportChannelProvider() {