B4A Library Firebase Email/Password authentication

Wrap to integrate firebase auth email/password authentication.
This library is partially copied from DonManfred authex lib.
Since there is no other working wrap of firebase email/password authentication I decided to challenge myself on creating my first library.
It may not be perfect, but it looks like working.
for reference visit: https://firebase.google.com/docs/auth/android/password-auth?authuser=4

FirebaseAuthEmail
Version:
1.4


Events:
  • usercreated (success As Boolean, User As FirebaseAuthEmailUser, info As String)
  • createfailure (success As Boolean, info As String)
  • signedin (success As Boolean, User As FirebaseAuthEmailUser, info As String)
  • signedinfailure (success As Boolean, info As String)
  • passwordreset (success As Boolean, info As String)
  • passwordresetfailure (success As Boolean, info As String)
  • userupdated (success As Boolean, info As String) <--- new
  • userdeleted (success As Boolean, info As String) <--- new
  • gettoken (success As Boolean, token As String, info As String)
Methods:
  • Initialize (eventName As String)
  • createUserWithEmailAndPassword (email As String, password As String, displayName As String, photoUrl As String)) <--- modified - displayName and photoUrl parameters. added in 1.4 version
  • signInWithEmailAndPassword (email As String, password As String)
  • sendPasswordResetEmail (email As String)
  • currentToken ()
  • updateProfile (displayName As String, photoUrl As String) <--- new
  • deleteuser () <--- new
  • SignOut

Properties:
  • CurrentUser As FirebaseAuthEmailUserWrapper [read only]


FirebaseAuthUser

Methods:
  • delete
  • sendEmailVerification
  • updateEmail (email As String)
  • updatePassword (password As String)
Properties:
  • Anonymous As Boolean [read only]
  • DisplayName As String [read only]
  • Email As String [read only]
  • EmailVerified As Boolean [read only]
  • IsInitialized As Boolean [read only]
  • PhotoUrl As String [read only]
  • ProviderData As List [read only]
  • ProviderId As String [read only]
  • Providers As List [read only]
  • Uid As String [read only]
 

Attachments

  • FirebaseAuthEmail_V1.3.zip
    13.3 KB · Views: 378
  • AuthSample.zip
    182.2 KB · Views: 244
  • FirebaseAuthEmail_V1.4.zip
    15.8 KB · Views: 234
Last edited:

DonManfred

Expert
Licensed User
Longtime User
ince there is no other working wrap of firebase email/password authentication
It is:

But anyway: thank you for Sharing! ;-)
 

Enrico Fuoti

Active Member
Licensed User
Longtime User
Hello Don,
I had no intention to replicate your work,
I only did it because when I asked you about the possibility to integrate some missing properties in authex2 you told me that there were no chances because you had lost your sources.
It was anyway a good chance for me to get some practice on writing libs
BTW, I posted Phone number Sign in lib..
https://www.b4x.com/android/forum/threads/firebase-phone-number-authentication.114218/
this was really missing AFAIK
 

DonManfred

Expert
Licensed User
Longtime User
I had no intention to replicate your work
It isn´t a problem at all. Just wanted to note that there is such a library. Not officially released though.
It was anyway a good chance for me to get some practice on writing libs
Keep up your practice-work and release more Libraries ;-)

BTW, I posted Phone number Sign in lib..
https://www.b4x.com/android/forum/threads/firebase-phone-number-authentication.114218/
this was really missing AFAIK

No, not really. It is included in the firebaseUI Library. And this one is released.
Yours is for sure much less in size.

Please don´t feel bothered with my answers; it is not my intention.
 

Enrico Fuoti

Active Member
Licensed User
Longtime User
Hello,
I was asked for a demo.. Attached to first post a small app, that combines Erel's Firebase auth, FirebaseAuthPhone and FirebaseAuthEmail.
make sure you have covered all the steps of Erel's Firebase auth tutorial first and that your google-services.json is added to the app folder.
 

yiankos1

Well-Known Member
Licensed User
Longtime User
Hello,
I tried your wrapper till now is working fine! Thank you very much for your time.

There is a problem with info message when authentication is failed. It throws two messages. Maybe it should be better to be exception instead of a string?

EDIT: If someone wants to show only the message
B4X:
MsgboxAsync(info.SubString(info.IndexOf2(":",10)).SubString(2),"")
 
Last edited:

Enrico Fuoti

Active Member
Licensed User
Longtime User
Hello PassionDev,
I will shortly post a new library upgrade that will incorporate display name set into the firebaseauth email user verification library.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…