Brett DeWoody
Brett DeWoody

Reputation: 62773

Firebase Auth - Import Users as Disabled

I'm importing users from my company's G Suite account to a Firebase application. The import follows the 'import users without passwords' process to import the users with Google as the OAuth Provider.

Some of our accounts in G Suite are suspended, and I'd like that to carry over when the user is imported to Firebase - so the Auth account is disabled. So far, the only method to disable a Firebase Auth account I've found is manually through the Firebase Console.

Is there a method for setting a user as disabled when importing using admin.auth().importUsers?

Upvotes: 0

Views: 346

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599001

Passing disabled: true into the imported users should work, but the documentation is quiet about it.

If that doesn't work, the closest is to disable the users through the Admin SDK immediately after importing them:

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

Upvotes: 2

Related Questions