As per docs https://cloud.google.com/identity-platform/docs/web/mfa we have an example for reCaptchav2 but how to implement MFA with reCaptchaV3 cause we have to pass the verifier in some functions like verifyPhoneNumber() but as far as I know, reCaptchav3 does not return a verifier.
For example Here,
var recaptchaVerifier = new firebase.auth.RecaptchaVerifier('sign-in-button', {
'size': 'invisible',
'callback': function(response) {
// reCAPTCHA solved, you can proceed with phoneAuthProvider.verifyPhoneNumber(...).
onSolvedRecaptcha();
}
});
for RecaptchaVerifier method it returns a recaptchaVerifier which we need to pass to the verifyPhoneNumber() method as an second argument.
var phoneAuthProvider = new firebase.auth.PhoneAuthProvider();
// Send SMS verification code.
return phoneAuthProvider.verifyPhoneNumber(phoneInfoOptions, recaptchaVerifier)
.then(function(verificationId) {
// verificationId will be needed for enrollment completion.
})
but here in the Recaptcha v3 render method it returns a widgetId which I cannot pass into the verifyPhoneNumber() method.
recaptchaWidgetId = grecaptcha.render('recaptcha-container', {
sitekey: 'abcdefghijklmnopqrstuvwxy-1234567890abcd',
callback: function (response) {
console.log('response', response)
resolver(response)
},
})
So my question was is there any way to get the reference of recaptchaVerifier from RecapchaV3 so that I can pass it to the verifyPhoneNumber() method. Or Is there any other way of implementing this?