android - Signup Firebase user without e-mail address -


i'm using following steps sign-up new firebase user. there way me set username parameter in future user can login using username & password ?

also, there way sign using username & password ,ie, not have option of e-mail id.

i've gone through following solution, doesn't seem efficient. suppose there better way of doing so.

firebase login , signup username

    private firebaseauth auth;     //get firebase auth instance    auth = firebaseauth.getinstance();      //create user    auth.createuserwithemailandpassword(email, password)    .addoncompletelistener(signupactivity.this, new oncompletelistener<authresult>() {                             @override                             public void oncomplete(@nonnull task<authresult> task) {                                 toast.maketext(signupactivity.this, "createuserwithemail:oncomplete:" + task.issuccessful(), toast.length_short).show();                                 // if sign in fails, display message user. if sign in succeeds                                 // auth state listener notified , logic handle                                 // signed in user can handled in listener.                                 if (!task.issuccessful()) {                                     toast.maketext(signupactivity.this, "authentication failed." + task.getexception(),                                             toast.length_short).show();                                 } else {                                     startactivity(new intent(signupactivity.this, mainactivity.class));                                     finish();                                 }                             }                         }); 

you can add domain behind username

register user < username > @summersapp.com.

note make impossible user reset password if forget it, since firebase uses email address send password reset email.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -