Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/393.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用firebase身份验证方法启用一次点击登录?_Javascript_Firebase_Firebase Authentication - Fatal编程技术网

Javascript 如何使用firebase身份验证方法启用一次点击登录?

Javascript 如何使用firebase身份验证方法启用一次点击登录?,javascript,firebase,firebase-authentication,Javascript,Firebase,Firebase Authentication,我正在尝试使用firebase auth实现一次点击登录,我已经从firebase auth和google开发者控制台启用了google,我获取了客户端id,并且当我尝试使用firebase auth和一次点击创建一次简单的一次点击登录时。我使用了firebase ui文档代码,但在我实施时,仍然无法看到任何点击登录,然后我获得了所有功能,但没有获得一次点击登录。我使用以下代码 import firebase from 'firebase/app'; import * as firebaseui

我正在尝试使用firebase auth实现一次点击登录,我已经从firebase auth和google开发者控制台启用了google,我获取了客户端id,并且当我尝试使用firebase auth和一次点击创建一次简单的一次点击登录时。我使用了firebase ui文档代码,但在我实施时,仍然无法看到任何点击登录,然后我获得了所有功能,但没有获得一次点击登录。我使用以下代码

import firebase from 'firebase/app';
import * as firebaseui from 'firebaseui'

const firebaseConfig = {
    apiKey: "",
    authDomain: "",
    databaseURL: "",
    projectId: "",
    storageBucket: "",
    messagingSenderId: "",
    appId: "",
    measurementId: ""
};

firebase.initializeApp(firebaseConfig);

let ui = new firebaseui.auth.AuthUI(firebase.auth());

let uiConfig = {
    signInOptions: [
        {
            provider: firebase.auth.GoogleAuthProvider.PROVIDER_ID,
            // Required to enable ID token credentials for this provider.
            // This can be obtained from the Credentials page of the Google APIs
            // console. Use the same OAuth client ID used for the Google provider
            // configured with GCIP or Firebase Auth.
            clientId: '',
            customParameters: {
                // Forces account selection even when one account
                // is available.
                prompt: 'select_account',
            },
        }
    ],
    // Enable one-tap sign-in.
    credentialHelper: firebaseui.auth.CredentialHelper.GOOGLE_YOLO
};

ui.start(".helper-firebase-ui", uiConfig);

使用class
helper firebase UI在UI中创建一个
div
,我使用以下代码

import firebase from 'firebase/app';
import * as firebaseui from 'firebaseui'

const firebaseConfig = {
    apiKey: "",
    authDomain: "",
    databaseURL: "",
    projectId: "",
    storageBucket: "",
    messagingSenderId: "",
    appId: "",
    measurementId: ""
};

firebase.initializeApp(firebaseConfig);

let ui = new firebaseui.auth.AuthUI(firebase.auth());

let uiConfig = {
    signInOptions: [
        {
            provider: firebase.auth.GoogleAuthProvider.PROVIDER_ID,
            // Required to enable ID token credentials for this provider.
            // This can be obtained from the Credentials page of the Google APIs
            // console. Use the same OAuth client ID used for the Google provider
            // configured with GCIP or Firebase Auth.
            clientId: '',
            customParameters: {
                // Forces account selection even when one account
                // is available.
                prompt: 'select_account',
            },
        }
    ],
    // Enable one-tap sign-in.
    credentialHelper: firebaseui.auth.CredentialHelper.GOOGLE_YOLO
};

ui.start(".helper-firebase-ui", uiConfig);

使用class
helper firebase UI

在您的UI中创建一个
div
,如果您也发布一些代码,这将非常有帮助。我们可以通过查看您尝试的内容来帮助您,如果您也发布一些代码的话,这将非常有帮助。我们可以看看你试过什么来帮你