我正在尝试使用谷歌我的业务应用程序接口创建一个平台,并且我正在使用谷歌一键登录以征得用户的同意,但是当我使用此代码时,当我单击一键登录时,会弹出另一个身份验证屏幕。这里是图像示例one tap sign in
2nd screen after one tap sign in我想删除第二个屏幕并继续获得gmb的同意
<script>
window.onload = function () {
google.accounts.id.initialize({
client_id:
"8.apps.googleusercontent.com",
callback: handleCredentialResponse,
});
google.accounts.id.prompt((notification) => {
if (notification.isNotDisplayed() || notification.isSkippedMoment()) {
console.log("opted out");
}
});
function handleCredentialResponse(response) {
// window.location = "https://github.com/";
const config = {
response_type: "permission",
scope: "https://www.googleapis.com/auth/plus.business.manage",
client_id:
"8.apps.googleusercontent.com",
};
gapi.auth2.authorize(config, function (response) {
});
}
};
</script>发布于 2020-08-03 23:55:53
第二个身份验证屏幕实际上是一个弹出窗口,这对于防止点击劫持很有用。
https://stackoverflow.com/questions/63204554
复制相似问题