Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the timeout for Firebase Phone Auth verification code? And how to set one?

In iOS, as per the official docs, there's no method to set a timeout duration for the phone number verification code (or even know the default one). Could some Firebaser clarify why is it so? What's the default timeout duration? If possible, how could one set it in iOS?

On the other hand, in Android, all is good: https://firebase.google.com/docs/auth/android/phone-auth#send-a-verification-code-to-the-users-phone

like image 831
rgoncalv Avatar asked Nov 08 '22 11:11

rgoncalv


1 Answers

FirebaseUI takes a different approach where they show a timer before they allow the user to resend the code (they use 15 seconds). This is a better approach as even if the expiration is provided, it will be inaccurate due to various latencies in the flow and the value is likely to change as Firebase Auth has the right to change that for security reasons. Otherwise, it could be used for brute force attacks.

The onCodeAutoRetrievalTimeOut timeout for Android is unrelated. It is the timeout for code auto retrieval before you ask the user to provide the code and not the timeout for code entry. Auto retrieval is an android feature only.

like image 104
bojeil Avatar answered Nov 14 '22 21:11

bojeil