firebasefirebase-authenticationfirebase-tools

Firebase emulator, set test phone sms code


When trying to authenticate with a phone against firebase auth emulator, the emulator output those kinds of messages:

To verify the phone number +16505551234, use the code 376579.

I would like to know if there is a way to set that code to be something static so I can run some integrations tests.

Just to be clear I already added a test phone to firebase (not the emulator) with it's code, but the emulator does not pick it up. The emulator ui interface does not seem to have the option to add one either.

It just generates a new code for every authentication and I want to put a static one for example "123456"


Solution

  • There is currently no way to set a static verification code as per the source here :

    https://github.com/firebase/firebase-tools/blob/7271c958eea82b8d223c0e581a94e3b5b7e57619/src/emulator/auth/state.ts