Forum Xamarin.Android

Xamarin.Firebase and Authentication

I have used Xamarin.Firebase in VS-Xamarin-Android to connect to firebase storage database from my android app.
It raises exception saying that "User does not have permission to access this object"...I can't figure out what to do with Firebase.Auth namespace.
Can anyone help me;
Sample below:

FirebaseOptions o = new FirebaseOptions.Builder()
FirebaseApp fa = FirebaseApp.InitializeApp(Application.Context, o);
FirebaseStorage fs = Firebase.Storage.FirebaseStorage.Instance;
StorageReference sr = fs.GetReferenceFromUrl(storagefile);
File localFile = File.CreateTempFile(filename, "jpg", Android.OS.Environment.ExternalStorageDirectory);



  • DylanSchoenmakersDylanSchoenmakers NLMember ✭✭

    You will need to login/auth with Firebase, or open up permissions. I could not get Auth to work (not even Anonymous sign in).

    Maybe you have more luck, this is what I've been trying to do:

    var auth = FirebaseAuth.GetInstance(firebaseApp);
    var authListener = new MyFirebaseAuthListener();

    authListener.AuthStateChanged += (object sender, EventArgs e) =>
    var firebaseUser = ((MyFirebaseAuthListener)sender).Auth.CurrentUser;


    auth.SignInWithCustomToken(firebaseToken).AddOnCompleteListener(new SigninCompleteListener());
    auth.SignInAnonymously().AddOnCompleteListener(new SigninCompleteListener());

    class SigninCompleteListener : Java.Lang.Object, IOnCompleteListener
    public void OnComplete(Android.Gms.Tasks.Task task)
    if (!task.IsSuccessful)

  • AnthonyClarkAnthonyClark USMember

    @PanagiotisKotsibos I was able to get Auth working after about a week of messing around. I uploaded to github if you would like to check it out.

    You will have to change MainLauncher in each activity since I reused the UI and mostly just tested one at a time.
    The database writing works as well but I have my database setup as default where the user must be authenticated.

    Also, I had to add my Certificate Fingerprints (SHA-1) for my app.

Sign In or Register to comment.