internal static async Task ImportWithStandardScrypt()

in FirebaseAdmin/FirebaseAdmin.Snippets/FirebaseAuthSnippets.cs [281:320]


        internal static async Task ImportWithStandardScrypt()
        {
            // [START import_with_standard_scrypt]
            try
            {
                var users = new List<ImportUserRecordArgs>()
                {
                    new ImportUserRecordArgs()
                    {
                        Uid = "some-uid",
                        Email = "user@example.com",
                        PasswordHash = Encoding.ASCII.GetBytes("password-hash"),
                        PasswordSalt = Encoding.ASCII.GetBytes("salt"),
                    },
                };

                var options = new UserImportOptions()
                {
                    Hash = new StandardScrypt()
                    {
                        MemoryCost = 1024,
                        Parallelization = 16,
                        BlockSize = 8,
                        DerivedKeyLength = 64,
                    },
                };

                UserImportResult result = await FirebaseAuth.DefaultInstance.ImportUsersAsync(users, options);
                foreach (ErrorInfo indexedError in result.Errors)
                {
                    Console.WriteLine($"Failed to import user: {indexedError.Reason}");
                }
            }
            catch (FirebaseAuthException e)
            {
                Console.WriteLine($"Error importing users: {e.Message}");
            }

            // [END import_with_standard_scrypt]
        }