B4A Library Firebase Email/Password authentication

Enrico Fuoti

Member
Licensed User
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.3


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)
  • gettoken (success As Boolean, token As String, info As String)
Methods:
  • Initialize (eventName As String)
  • createUserWithEmailAndPassword (email As String, password As String)
  • signInWithEmailAndPassword (email As String, password As String)
  • sendPasswordResetEmail (email As String)
  • currentToken ()
  • 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

Last edited:

DonManfred

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

But anyway: thank you for Sharing! ;-)
 

Enrico Fuoti

Member
Licensed 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
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

Member
Licensed 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

Active Member
Licensed 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:
Top