Step 2: Describe your environment
- Operating System version: all
- Firebase SDK version: 4.1.0
- Firebase Product: auth
Step 3: Describe the problem
Firebase Local Emulator Suite has Authentication Emulator, but this SDK doesn't support the emulator yet.
While Realtime Database emulator support being discussed on #298, I believe emulator support can be implemented separately for each product, so I opened a new issue to discuss about Authentication Emulator support.
To support auth emulator, following implementation should be added (We can borrow the ideas of Node.js Admin SDK which already supports the emulator; cf. firebase/firebase-admin-node#1044):
- Provide a way to configure the auth client to use the Emulator Suite.
- To be consistent with original Node.js implementation, auth emulator support should be enabled via setting
FIREBASE_AUTH_EMULATOR_HOST environment variable.
- Emulated signer for token generation / validation.
- Replace identity toolkit API endpoints with local (emulated) ones when using the emulator.
The steps above mostly been deduced from Node.js implementation, so they are incomplete perhaps.
Relevant Code:
I've submitted a PR. #414
Step 2: Describe your environment
Step 3: Describe the problem
Firebase Local Emulator Suite has Authentication Emulator, but this SDK doesn't support the emulator yet.
While Realtime Database emulator support being discussed on #298, I believe emulator support can be implemented separately for each product, so I opened a new issue to discuss about Authentication Emulator support.
To support auth emulator, following implementation should be added (We can borrow the ideas of Node.js Admin SDK which already supports the emulator; cf. firebase/firebase-admin-node#1044):
FIREBASE_AUTH_EMULATOR_HOSTenvironment variable.Sign(), and returnsfirebase-auth-emulator@example.comfromEmail().Algorithm()method to signers, to switch algorithm to sign custom tokens based on which signer the client uses (Emulated signer usesnonealgorithm, other signers useRS256. cf. https://github.com/firebase/firebase-admin-node/blob/dbb0c785c9b72590c19655d3ab5a39338e0cd393/src/auth/token-generator.ts#L231-L252).The steps above mostly been deduced from Node.js implementation, so they are incomplete perhaps.
Relevant Code:
I've submitted a PR. #414