回答

1

createUser()函數讓你做到這一點。

admin.auth().createUser({ 
    email: "[email protected]", 
    emailVerified: false, 
    password: "secretPassword", 
    displayName: "John Doe", 
    photoURL: "http://www.example.com/12345678/photo.png", 
    disabled: false 
}) 
.then(function(userRecord) { 
    // See the UserRecord reference doc for the contents of userRecord. 
    console.log("Successfully created new user:", userRecord.uid); 
}) 
.catch(function(error) { 
    console.log("Error creating new user:", error); 
}); 

https://firebase.google.com/docs/auth/admin/manage-users#create_a_user

+0

我目前正在試圖做到這一點,而這會導致「不夠的權限訪問請求的資源。」。我已經用admin.initializeApp(functions.config()。firebase)初始化應用程序, – tonsteri

相關問題