简体   繁体   English

Firebase 用户电话号码验证

[英]Firebase user phone number verification

I can see that Firebase has phone number authentication but all I want is just to verify the phone number.我可以看到 Firebase 具有电话号码身份验证,但我只想验证电话号码。 I do not want to sign in using the phone number.我不想使用电话号码登录。 Can I achieve this or should I use other service for sms verification?我可以做到这一点还是应该使用其他服务进行短信验证?

Verifying the phone number is part of signing the user in to Firebase Authentication.验证电话号码是用户登录 Firebase 身份验证的一部分。 You cannot use Firebase phone number authentication without signing the user in to Firebase Authentication.在用户登录 Firebase 身份验证之前,您无法使用 Firebase 电话号码身份验证。

That said: there are many situations where you can likely leave the user signed in to Firebase without problems.也就是说:在很多情况下,您可以让用户毫无问题地登录 Firebase。

you can just use this你可以用这个

import React from "react";
import StyledFirebaseAuth from 'react-firebaseui/StyledFirebaseAuth';
import firebase from "firebase";
import './firebaseui-styling.global.css';

const config = {
  // your firebase config
};

firebase.initializeApp(config);



const PhoneVerification = () => {

    const uiConfig = {
        signInFlow: 'popup',
        signInOptions: [
            {
                provider: firebase.auth.PhoneAuthProvider.PROVIDER_ID,
                recaptchaParameters: {
                    type: 'image',
                    size: 'invisible',
                    badge: 'bottomleft'
                },
                defaultCountry: '+91',
                whitelistedCountries: ['IN', '+91']
            }
        ],
        // callbacks: {
        //     signInSuccessWithAuthResult: function (authResult) {
        //         var no = firebase.auth.PhoneAuthCredential
        //         console.log(no)
        //     }
        // }
    }

    return (
        <div>
            <StyledFirebaseAuth uiConfig={uiConfig} firebaseAuth={firebase.auth()} />
        </div >
    )
}

export default PhoneVerification

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase电话身份验证限制 - Firebase phone auth verification limit Firebase IOS-使用电话号码创建用户 - Firebase IOS - Create user with phone number 使用 FirebaseAuth 电话号码验证进行测试 - Testing with FirebaseAuth Phone Number verification recaptcha 验证后的空白页使用电话号码 Swift 在 iOS 上使用 Firebase 进行身份验证 - blank page after recaptcha verification Authenticate with Firebase on iOS using a Phone Number Swift 在将值传递给Firebase电话身份验证以在Swift 4中进行验证之前,如何将用户输入从6个OTP UITextFields存储到属性中 - How to store user input from 6 OTP UITextFields to a property before passing the value to Firebase phone authentication for verification in Swift 4 Firebase验证电话号码,然后使用Swift使用电子邮件/密码对用户进行身份验证 - Firebase verify phone number then authenticate user with email/password with Swift 短信电话号码验证的替代方法-全球 - Alternative to SMS phone number verification - worldwide 电话号码验证失败 - Flutter(仅限 iOS) - Phone number verification failed - Flutter (iOS ONLY) 编程未将验证码发送到给定的电话号码 - Programming not sending verification code to given phone number Firebase - 如何在创建新用户之前检查电话身份验证中是否存在电话号码 - Firebase -How to check if a phone number exists inside phone auth before creating a new user
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM