firebase / firebase/firebase-js-sdk
FR: Ability to use RecapchaVerifier in other use cases besides phone auth
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
### [REQUIRED] Describe your environment
* Operating System version: any
* Browser version: any
* Firebase SDK version: 7.x
* Firebase Product: auth
### [REQUIRED] Describe the problem
#### Context
Sometimes it's necessary to protect cloud functions by recaptcha.
Firebase has RecaptchaVerifier implementation that is used in Sign in with phone number. Documentation states that site key and secret key are automatically generated for the project. RecaptchaVerifier accepts all parameters EXCEPT siteKey, because it's automatically generated. There is explicit check that throws error if siteKey parameter is specified.
On the server, in order to verify Recaptcha response it's necessary to have secret key that matches siteKey that was used on the client.
#### Question
Is there a way to get automatically generated secret key that matches site key used by RecaptchaVerifier on the server in a cloud function?
#### Proposed Solution
Allow clients to specify siteKey when creating instance of RecaptchaVerifier so that it can be used to protect any server function.
Contributor guide
Assessment
This issue has not been assessed yet.