Skip to content

Commit

Permalink
fix: use test credentials when connecting to the Emulator from the Fi…
Browse files Browse the repository at this point in the history
…rebase Admin SDK (#296)
  • Loading branch information
schmidt-sebastian committed Jul 16, 2020
1 parent 84f602e commit a0a6e80
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -19,6 +19,7 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.InternalApi;
import com.google.api.gax.core.CredentialsProvider;
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.rpc.TransportChannelProvider;
Expand Down Expand Up @@ -255,7 +256,9 @@ public ManagedChannelBuilder apply(ManagedChannelBuilder input) {
}
})
.build());
this.setCredentials(new FakeCredentials());
// Use a `CredentialProvider` to match the Firebase Admin SDK, which prevents the Admin SDK
// from overwriting the Emulator credentials.
this.setCredentialsProvider(FixedCredentialsProvider.create(new FakeCredentials()));
}

return new FirestoreOptions(this);
Expand Down

0 comments on commit a0a6e80

Please sign in to comment.