[Firebase]匿名認証サンプルコード

匿名認証サンプルコード


            const firebaseConfig = {
                apiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                authDomain: "sample.firebaseapp.com",
                databaseURL: "https://sample.firebaseio.com",
                projectId: "sample",
                storageBucket: "sample.appspot.com",
                messagingSenderId: "XXXXXXXXX",
                appId: "1:XXXXXXX:web:XXXXX"
            };

            const app = firebase.initializeApp(firebaseConfig);

            await firebase.auth().signInAnonymously().catch(e => {
                console.log(e)
            })


[Firebase]auth/admin-restricted-operation This operation is restricted to administrators only.エラー対応

Firebaseで認証時に以下のエラーの対応

auth/admin-restricted-operation This operation is restricted to administrators only.

Firebaseのコンソール画面 >   Authentication >  Sign-in method  > 利用したい認証方式有効