firebase / firebase/firebase-admin-java

[FR] Connect to Firebase Emulator (Auth) using custom hostname and port

Open
#772 12 comments 2 reactions 0 assignees View on GitHub
api: core help wanted type: feature request
Dominant language
Java
Stars
620
Forks
305
Avg merge
3h 23m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**
I am trying to setup a testing phase that would run tests on the Emulator by connecting to it. The Emulator is prepared using TestContainers which don't open specific ports, but rather random. Because of this I cannot use the environment variable specified as that blocks me into selecting a hostname and port.

**Describe the solution you'd like**
Make the hostname and port dynamic when initialising FirebaseAuth / FirebaseApp.

**Describe alternatives you've considered**
-

**Additional context**
### Expected usage
```
FirebaseAuth.getInstance(firebaseApp()).useEmulator('localhost', '9099')
```

For example, Firestore has this enabled using `FirestoreOptions.newBuilder().setEmulatorHost()`

Contributor guide

Open the contributing guide

Research direction

Start by tracing FirebaseAuth and FirebaseApp initialization, then compare the existing FirestoreOptions.setEmulatorHost() approach. The work is done when FirebaseAuth.getInstance(firebaseApp()).useEmulator('localhost', '9099') accepts a custom hostname and port for emulator connections, including dynamically assigned TestContainers endpoints.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, java
Domain
authentication
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.