firebase / firebase-admin-dotnet

Firebase Admin .NET SDK
https://firebase.google.com/docs/admin/setup
Apache License 2.0
369 stars 131 forks source link

FR: Implement ImportUsersAsync() API #185

Closed hiranya911 closed 4 years ago

hiranya911 commented 4 years ago

Implement an API for importing Firebase Auth user accounts in bulk. Partial API proposal:

class FirebaseAuth
    Task<UserImportResult> ImportUsersAsync(IEnumerable<ImportUserRecordArgs> users)
    Task<UserImportResult> ImportUsersAsync(IEnumerable<ImportUserRecordArgs> users, UserImportOptions options)

class ImportUserRecordArgs
    string Uid { get; set; }
    string Email { get; set; }
    boolean EmailVerified { get; set; }
    string DisplayName { get; set; }
    string PhoneNumber { get; set; }
    string PhotoUrl { get; set; }
    boolean Disabled { get; set; }
    UserMetadata UserMetadata { get; set; }
    byte[] PasswordHash { get; set; }
    byte[] PasswordSalt { get; set; }
    IEnumerable<UserProvider> UserProviders { get; set; }
    IReadOnlyDictionary<string, object> CustomClaims  { get; set; }

class UserImportResult
    int SuccessCount { get; }
    int FailureCount { get; }
    IReadOnlyList<ErrorInfo> Errors { get; }
MathBunny commented 4 years ago

Merged in #191, remaining work is to make a release that includes the change.

hiranya911 commented 4 years ago

Will be included in the next release.