Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable user accounts on firebase authentication automatically?

I am currently working on an android application which uses Google Firebase as the back end server.

One function I want to implement is disabling user accounts as they register through the application but I don't know how to do it.

Does anyone know how to implement this into the android code itself?

like image 834
Dckw24 Avatar asked Mar 31 '17 12:03

Dckw24


People also ask

How to disable user in Firebase?

There's no method to disable a user account from the Android client SDK. You have to use Firebase Admin SDK for this. You can also trigger this function when a Firebase user is created on Firebase Cloud Function.


1 Answers

There's no method to disable a user account from the Android client SDK.

You have to use Firebase Admin SDK for this.

admin.auth().updateUser(uid, {
    disabled: true
});

Guide link: Firebase Admin - Update a user

EDIT: Thanks @FrankvanPuffelen

You can also trigger this function when a Firebase user is created on Firebase Cloud Function.

read more here

like image 116
Wilik Avatar answered Sep 27 '22 21:09

Wilik