简体   繁体   English

如何设置弹出窗口不显示Google+的Google登录

[英]How to setting Google Sign-In for Google+ not show by popup

I implement G+ sign-in function in my site, document here . 我在自己的网站中实现了G +登录功能,请在此处记录 The problem is google show sign-in dialog by popup. 问题是Google弹出显示登录对话框。 This way make my site break in iOS if I bookmark it home screen. 如果我在首页上添加书签,这种方式会使我的网站在iOS中中断。 It cannot close the popup. 它无法关闭弹出窗口。 Does it has some options to open sign-in by another way? 它是否可以通过其他方式打开登录?

在此处输入图片说明

There is another way, but it's slightly more complicated. 还有另一种方法,但是稍微复杂一些。

You can follow the instructions in the Google OpenID Connect documentation. 您可以按照Google OpenID Connect文档中的说明进行操作。 Broadly, it involves directing the user to an authorization endpoint from which you get back a code. 广义上讲,它涉及将用户定向到授权端点,您可以从授权端点取回代码。 You then exchange that code at the token endpoint for access, ID, and refresh tokens. 然后,您可以在令牌端点交换该代码以获取访问,ID和刷新令牌。

The best way to learn how this flow works in an interactive way is using the OAuth Playground . 学习这种流程以交互方式工作的最佳方法是使用OAuth Playground Try entering profile email openid in the "input your own scopes" box, then tap Authorize APIs. 尝试在“输入您自己的范围”框中输入profile email openid ,然后点击“授权API”。 Here's an example auth URL . 这是一个示例auth URL

The docs for verifying the ID Token detail how to use the ID Token to authenticate the user, by extracting the sub value. 验证ID令牌的文档详细介绍了如何通过提取sub值来使用ID令牌对用户进行身份验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM