如何使用firebase auth为web应用程序实现google one tap登录?
我试图用firebase auth实现google一键登录,但我知道firebase ui不支持yolo。我曾尝试使用firebase ui文档,但无法使用firebase auth实现google one tap登录。有人能建议我如何实施这一点吗。我已经在没有firebase auth的情况下实现了,但我想用firebase auth实现如何使用firebase auth为web应用程序实现google one tap登录?,firebase,web,firebase-authentication,firebaseui,Firebase,Web,Firebase Authentication,Firebaseui,我试图用firebase auth实现google一键登录,但我知道firebase ui不支持yolo。我曾尝试使用firebase ui文档,但无法使用firebase auth实现google one tap登录。有人能建议我如何实施这一点吗。我已经在没有firebase auth的情况下实现了,但我想用firebase auth实现 <!DOCTYPE html> <html lang="en"> <head> <
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="https://www.gstatic.com/firebasejs/4.1.3/firebase.js"></script>
<!-- <script src="config.js"></script>
<script src="common.js"></script> -->
<script src="https://cdn.firebase.com/libs/firebaseui/3.5.2/firebaseui.js"></script>
<link
type="text/css"
rel="stylesheet"
href="https://cdn.firebase.com/libs/firebaseui/3.5.2/firebaseui.css"
/>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script src="https://accounts.google.com/gsi/client" async defer></script>
<script src="https://apis.google.com/js/client.js?onload=authorize"></script>
</head>
<body>
<div id="firebaseui-auth-container"></div>
<div id="loader">Loading...</div>
<script>
ui.start("#firebaseui-auth-container", {
signInOptions: [
{
// Google provider must be enabled in Firebase Console to support one-tap
// sign-up.
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:
"321013-ab7ep38c2f6fmb975nqbo09f3eca8569.apps.googleusercontent.com",
},
],
// Required to enable one-tap sign-up credential helper.
credentialHelper: firebaseui.auth.CredentialHelper.GOOGLE_YOLO,
});
// Auto sign-in for returning users is enabled by default except when prompt is
// not 'none' in the Google provider custom parameters. To manually disable:
ui.disableAutoSignIn();
</script>
</body>
</html>
文件
加载。。。
ui.start(“#firebaseui身份验证容器”{
签署:[
{
//必须在Firebase控制台中启用Google provider才能支持一次点击
//报名吧。
提供程序:firebase.auth.GoogleAuthProvider.provider\u ID,
//必须启用此提供程序的ID令牌凭据。
//这可以从谷歌API的凭证页面获得
//控制台。使用与Google提供程序相同的OAuth客户端ID
//配置了GCIP或Firebase身份验证。
客户ID:
“321013-ab7ep38c2f6fmb975nqbo09f3eca8569.apps.googleusercontent.com”,
},
],
//需要启用一个点击注册凭据帮助程序。
credentialHelper:firebaseui.auth.credentialHelper.GOOGLE_YOLO,
});
//默认情况下,将启用返回用户的自动登录,除非出现提示
//在Google provider自定义参数中不是“无”。要手动禁用:
ui.disableAutoSignIn();
我在以下网站上找到了关于Google One Tap与Firebase和Angular集成的指南:。
不过我没有试过