我正在尝试使用firebase auth实现一键登录,我已经从firebase auth中启用了google,并从google开发者控制台获取了客户端id,当我试图使用firebase auth和一键创建一个简单的一键登录时。我使用了firebase ui文档https://github.com/firebase/firebaseui-web#one-tap-sign-up代码,但在实施https://fir-auth-f72fb.firebaseapp.com/时,我仍然看不到任何一键登录,然后我获得了所有功能,但没有一键登录
发布于 2021-03-27 08:02:59
我使用了下面的代码
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);
使用类helper-firebase-ui
在UI中创建一个div
https://stackoverflow.com/questions/63445677
复制相似问题