Phone authentication session control in android using firebase - android

I am trying to put (email-id, password), login by otp. In the 1st case, it moves to the other activity through which they have to login after verification of their mail. So here I am checking by is Email Verified method and if yes then it redirects to home page. In the 2nd case, is there any method like the 1st case for if mobile verified? Please help

You can use firebase phone auth for your 2nd case,
You can use Firebase Authentication to sign in a user by sending an SMS message to the user's phone. The user signs in using a one-time code contained in the SMS message.
You can use this once the user is not yet verified through sms, then add flag like 'isMobileVerified' on your database which you'll update after the user has verified via the code sent on his/her number.
Please see doc here

Related

Registration in Firebase using OTP

I want to make an app in Android Studio where the user will have to register in Firebase using his mobile phone number. But the user would only be allowed to register if he verifies his phone number with the OTP sent to him via SMS.
I don't want to allow anyone with a fake phone number to register and hence I need them to verify. So is there a way to do so in Firebase?
I tried the auth.signInWithCredential() method but it seems to allow users to only sign in with an OTP. I also don't want my users to type an OTP every time they sign in. I want them to sign in using only their password and phone number.

What firebase check Email is valid or not used for new user registration?

I am registering a user in firebase using wrong Email and Password authentication, It register the user successfully and when ask for reset the password it is showing reset mail send successfully on firebase console. Is this is a bug or Firebase does not check wether the eamil is valid or not?
Firebase Authentication does not automatically send verification emails. This is not a bug, since there are many scenarios where such an email may be unwanted or unnecessary.
If your app requires that the user's email address is verified before they can use you app, you will have to send it by calling sendEmailVerification from your app before allowing them access.

Firebase Phone auth by call

Suppose I need to verify users by Firebase phone authentication.
But somehow, user is not getting otp sms. So does firebase gives the option to get the OTP by receiving call?
You can use Firebase Authentication to sign in a new user by sending an SMS message to his phone, he would then receive a verification code to his phone number via SMS which would then allow him to sign in if the code is correct. However it's not possible yet to give the user his verification code via a voice call. Maybe they will do it in a future release ? It would be great indeed !

Sending Welcome Email to User when he/she Sign Up for the First Time in Firebase

I am developing and android app that uses google Firebase as an authentication provider.I searched out a lot but can not find appropriate answer.I want to send custom Welcome email to user when he/she sign up for the first time.Like the email contain simple "Welcome to Our service Hope you would enjoy our service etc.
Any One have any idea would be appreciated and thank in advanced.
My question is not about how to send the email from phone using intent service but i want to send the email in background without opening any email sending dialog just like email service from amazon that contain info about their service or products.i just want to send email once when the user sign up in firebase for the first time.
You need to use Firebase Cloud Function !
This sample will help you.
With Firebase Cloud Function you can add a trigger on the user account creation and send him a welcome email.
Other sample here.
you can use NodeJs with nodemailer link and check this tutorial or a little trick if you will not use the reset password option, go to firebase console> authentication > templates, for the email verification you can not change the template but for the password reset you can change it with the body you wants. After your user sign in use auth.sendPasswordResetEmail(email) to send the email, nothing will happens to the account and you still have access on it.

Firebase Email Verification Android

I am trying having a little bit of a problem in my application which uses firebase to store usernames and send verification emails. I have gotten to the point where you can create an account and it will send a verification link. So, I was wondering since if someone registers with an email firebase automatically registers it, so can't a person that just type a random email, say for example test#test.com and then the real owner of test#test.com tries registering but can't because the email is already taken even though the imposter didn't/can't verify it the verification link. Is there any way to make it so that the email is only registered in the firebase auth once the verification link has successfully been clicked by the person that really owns that email?
Any help would be greatly appreciated! (Also I am very new to firebase)
Here is my Java class code:
https://pastebin.com/HP7Q15Gh
When you send the email verification, it won't be verified until the link is clicked, so even if User A tries to verify UserB#example.com, it will send the link, but won't create the account until the email is verified. If User B tries to create an account, another email would be sent to UserB#example.com, which they could verify. The template very clearly says:
If you didn’t ask to verify this address, you can ignore this email.
This would allow the "real" user to create an account with their own address if the wanted to.
If you want to end-to-end test email verification try EmailE2E.com — it's free.
You can send and receive emails from randomly generated inboxes via an API.
It's perfect for testing Firebase, Amazon Cognito, or other OAuth providers that use email verification codes during sign up. Plus it has clients in Java and JS.

Categories

Resources