how to add the hash key to firebase OTP sms body section - hash

we have checked the autofill functionality for android. so we needed the 11 char hash key to be added into the OTP SMS body. how to add that into firebase phone auth OTP message.
we referred to this documentation:
https://developers.google.com/identity/sms-retriever/overview

As of 2nd July 2021:
This is expected behavior - your application's name is long enough that it crowds out the application hash from the SMS.
Shortening the name of the app is the only fix for now
Read More
https://github.com/firebase/firebase-android-sdk/issues/2688#issuecomment-860940110

Related

Firebase sms auto fill not working after app published to play store

looking for some help with the auto-fill OTP function for my app while using Firebase authentication service. Auto fill functionality works fine in test app as sms has the hash code. But when I publish the app on Google Playstore, the hash code in the OTP authentication sms is replaced by the app name, and hence the sms auto fill stops working as it requires the hash code. Will be great if someone has come across this problem and can help with some solution or workaround.
What's is the workaround to this
I faced the same issue and mine was due to the app name too long to contain the hash-code. Below are few work around:
You need to make sure the message you receive contains the hash of your app. Below is the right format :
123456 is your verification code for %APP_NAME%.
xyz_hascode_123
If your SMS does not contain the hashCode at the end, you might have to shorten your app name to less than 16 characters.
If your app is already published on Google Play, the name in the SMS will be the same as the one in the GooglePlayStore.
If you changed the name to 15 characters and the error still persists, you might have to wait for at least 24hours for the change to reflect on Firebase.
If after all the above it's still not resolved, please check if your receiver is well configured in the code.
Check out the new GooglePlay policy on app names: Common app names violations

Firebase OTP SMS has two codes, one for verification and another that's always the same for all users [duplicate]

Used Firebase Phone Auth in my Android app.
The sms contains extra characters ntEc9wgP0/J at the end of the template.
Tried setting FirebaseAuth.getInstance().setLanguageCode("en")
Template language is set to English in Firebase console.
What can be the reason behind this?
This is my sms code template in firebase console.
%LOGIN_CODE% is your verification code for %APP_NAME%.
Firebase Phone Auth itself is working absolutely fine. What am I missing here?
EDIT : image of problem
EDIT2 : how it should be
I also faced the same issue in my case auto retrieval hash was only coming when otp sms length was below 53 characters so i contacted firebase support team regarding this .
As per firebase support team "If this is Android traffic then this is the appended auto-retrieval hash. We use the SMS Retriever API . So this extra characters are expected because these are the auto-retrieval hash"
** To Increase the character length you can change your app name on the google console.

Can I use sendEmailVerification method for a passwordless purpose? (firebase, flutter)

I have a multipage (3 pages) account signup that contains
Email verification (ONLY enter the email, click send button then verify)
Choose the interest categories (if the email is verify)
Enter the major and graduation year
I previously used a package that sends OTP to the email that is entered in the textfield and it is no longer supported. So now I am looking at sendEmailVerification that sends the verification link to the email. However, all the examples I have looked are having both email address AND password in their sign up page. Can I still use that method for my case (passwordlessly)? Please help.
you can use Email-link-auth if you want an email-only login.

Looking for a way to verify email addresses using Swift and Firebase

I'm currently looking for a solution for creating an iOS application using swift and Firebase as an authentication and database storage system. I'm relatively new to swift and Firebase. I currnently have methods in place that validate the input of my text, in the given text fields in a form.
Here is my method used to validate the format of the email. "Utilities" is in reference to a expression that shows the valid format.
let cleanedEmail = emailAddressTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
if Utilities.isValidEmail(cleanedEmail) == false {
return "Please enter a valid email address."
I'm looking to now "Verify" an email address in swift and firebase, and find a method or function to verify wether the email address given by a user on signup is real and not just given to support the format of the validation method I have created. This helps me prevent errors on input for users when they sign up.
Just to be clear, if I give a valid email address of "Jack#fmail.com" it will be accepted even if it isn't a real domain. Therefore if a user mistypes their email address it will create an account on a false domain.
If anyone has any suggestions,I'd be happy to hear them.
Thank you.
The most common used option is to send a verification mail to the user. You can activate that functionality in your Firebase console under the Authentication setting. See image and the link for more information on how to set it up in your app.
https://firebase.google.com/docs/auth/ios/email-link-auth

AWS Lambda & Cognito - Updating user phone number attribute without sending an SMS

I am working on an iOS app using Amazon Web Services and I am setting up a user data base using the Cognito Userpool. During the sign up process, if a user enters the wrong phone number by mistake and in result isn't receiving a verification code, I am trying to allow them to then enter a new phone number, and update their phone number user attribute. Right now I am using a Lambda function which uses the AdminUpdateUserAttribute function, which is then connected to a APIGateway which allows me to run it from XCode. The function itself works and it successfully updates the phone number attribute.
Problem
The problem that I am running into though, is that after the phone number attribute has been updated with the Lambda function, a verification code is automatically sent to the newly updated phone number via SMS. The verification code is weird though because when I use that code to confirm the user, it doesn't work. Meaning that code is invalid for confirmation purposes. But if I use the Resend Confirmation Code function it will then send a valid confirmation code to the newly updated phone number.
Question
So I guess the questions I have are:
How can I prevent the automatic SMS from sending after I update the user's phone number attribute?
Or, is there a way I can use the verification code that is automatically sent as a confirmation code?
Thank you in advanced.