Firebase sign In email/password

DonManfred

Expert
Licensed User
Longtime User
He need a customized UI.
Firebase UI comes with its own Layout.

Away from that the newest Firebase UI which depend on AndroidX i did not get working (for months now)
 

ilan

Expert
Licensed User
Longtime User
He needs a customized UI.
Firebase UI comes with its own Layout.

Away from that the newest Firebase UI which depend on AndroidX i did not get working (for months now)

I don't understand what you understand from his post. what i understand is that he wants an example (or create a lib) to login to firebase using Gmail account so basically, firebase auth what we already have here. where is he asking about UI?? don't see that in his question.

@gregorio_adrian_gimenez can you please explain what you need? do you want to use a Login Option in your app using Gmail accounts?
 

gregorio_adrian_gimenez

Active Member
Licensed User
Longtime User
Hi, what I need is a library that allows me to log in with an email / password, not gmail. The FirebaseAuthex library has some problems. A moment ago I published a code, which solves these inconveniences, however, it is not a fundamental solution.
Thanks for answering!
 

ilan

Expert
Licensed User
Longtime User

ilan

Expert
Licensed User
Longtime User
Hi, thanks for replying, is it that I need to log in to Firebase, does this solution apply?

no it is a db on your server (if you have one) if not you can get also for free a server.
firebase does offer firebase DB and you could use it to add users to it. i did a simple example on android studio and it works fine i think @DonManfred has wrapped firebase db lib. you may look for it.

sorry forget what i wrote above, you can also use your own email account to create firebase users. but i think there is no example on this forum.
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
also that you can reset password or delete an account
I got it working writing a new wrapper. Google has changed something or i do not get the dependencies right.
Anyway:
- I got it working together with FirebaseAuth.
- You can request signin per email and password; bout you do not get any userinfos with firebase authex. But you can use the FirebaseAuth methods to check/get the currentuser and to get the userinfos.
B4X:
authex.signInWithEmailAndPassword("xxx","yyy")

B4X:
Sub AuthEx_onAuthenticated(success As Boolean, result As Object, info As String)
    Log($"AuthEx_onAuthenticated(${success}, ${result}, ${info})"$)
    If success Then
        If auth.CurrentUser.IsInitialized Then Auth_SignedIn(auth.CurrentUser)
    End If
End Sub

- You can send a request to reset a password using

B4X:
Sub btnResetPassword_Click
    authex.sendPasswordResetEmail("xxx") ' replace xxx by the email for which the password should get resetted.
End Sub

B4X:
Sub AuthEx_PasswordReset(success As Boolean)
    Log($"AuthEx_PasswordReset(${success})"$)
End Sub

The event just tells about the success of this method to "send the email".
The user must read his email, click the link in the email to reset the password and to set a new one.
After he did this
mapcanvas096.png


the user now can use his new password.

Unfortunately delete a useraccount i did not get to work based on internal dependencies.

You maybe can try to use the Firebase Rest Api to do so.
 

Attachments

  • FBAuthEx2.zip
    13 KB · Views: 262
  • FirebaseAuthEx2V0.02.zip
    5.5 KB · Views: 257

gregorio_adrian_gimenez

Active Member
Licensed User
Longtime User
Hi Mandfred, unfortunately I can't use the FBAuthEx2 library, because it doesn't have the function to create an account.
This function in FBAuthEx and the two enabled libraries conflict.
FBAuthEx also cannot be declared in Process_Global.
Can this be resolved?
From already thank you very much
 
Top