我正在尝试实现带有firebase身份验证的google一键登录,但我知道firebase ui不支持yolo。我也尝试过使用firebase ui文档,但我无法实现带有firebase身份验证的google一键登录。有人能建议我如何实现这一点吗?我已经在没有使用firebase身份验证的情况下实现了,但是我想使用firebase身份验证来实现
<!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>发布于 2020-10-11 19:09:27
我在https://mobilelabs.in/learn-google-one-tap-integration-with-firebase-and-angular/上找到了Google One Tap与Firebase和Angular集成的指南。不过,我没有试过。
https://stackoverflow.com/questions/64292684
复制相似问题