I am getting the runtime error of message = "ADMIN_ONLY_OPERATION"; while using the below code

Make sure you have enabled the Anonymous login in your Firebase Console. Take a look at the picture and enable the marked switch. You can find the Firebase Console here.


In addition to Constantin Beer's answer (i'e enabling the anonymous sign in method from firebase), google has enrolled this new beta feature (the identity platform) where you would need to check Enable create (sign up) option. This is mentioned nowhere in the documentation yet, Alex Kozlowski spent a lot of time figuring this out. Please refer the image below

enter image description here