如何在 Google AMP 中实现 Google 和 Facebook 的登录按钮?
How to implement a sign-in button of Google and Facebook in a Google AMP?
我想创建一个简单的 "sign-in" Facebook 按钮和 Google。
我阅读了文档 (https://amp.dev/documentation/examples/personalization/oauth2_login/#setup)
并查看 playground 部分中的示例,但我的问题是我该怎么做
"facebook-sign-in": "https://ampbyexample.com/oauth/login/facebook",
"google-sign-in": "https://ampbyexample.com/oauth/login/google",
在 AMP 文档示例中:
<script id="amp-access" type="application/json">
{
"authorization": "https://ampbyexample.com/oauth/status?_=RANDOM",
"noPingback": "true",
"login": {
"facebook-sign-in":"https://ampbyexample.com/oauth/login/facebook",
"google-sign-in":"https://ampbyexample.com/oauth/login/google",
"github-sign-in":"https://ampbyexample.com/oauth/login/github",
"sign-out":"https://ampbyexample.com/oauth/logout"
},
"authorizationFallbackResponse": {
"error": true,
"loggedIn": false
}
}
</script>
在我的应用程序中 https://ampbyexample.com/oauth/login/facebook 这个文件中我要做什么?我需要做什么?我对这部分很困惑。
编辑
我发现 this example but how make this logic with facebook without open a new pop up inside of amp's popup? (https://developers.facebook.com/docs/facebook-login/web) about this example, my login button just stay inside of amp popup... but my expected result is like this example here
Sign-in 和 amp-access 将始终打开一个新的弹出窗口。这是为了确保始终可以在您自己的来源上编写第一方 cookie,即使 AMP 页面是从 AMP 缓存提供的。
我想创建一个简单的 "sign-in" Facebook 按钮和 Google。
我阅读了文档 (https://amp.dev/documentation/examples/personalization/oauth2_login/#setup) 并查看 playground 部分中的示例,但我的问题是我该怎么做
"facebook-sign-in": "https://ampbyexample.com/oauth/login/facebook",
"google-sign-in": "https://ampbyexample.com/oauth/login/google",
在 AMP 文档示例中:
<script id="amp-access" type="application/json">
{
"authorization": "https://ampbyexample.com/oauth/status?_=RANDOM",
"noPingback": "true",
"login": {
"facebook-sign-in":"https://ampbyexample.com/oauth/login/facebook",
"google-sign-in":"https://ampbyexample.com/oauth/login/google",
"github-sign-in":"https://ampbyexample.com/oauth/login/github",
"sign-out":"https://ampbyexample.com/oauth/logout"
},
"authorizationFallbackResponse": {
"error": true,
"loggedIn": false
}
}
</script>
在我的应用程序中 https://ampbyexample.com/oauth/login/facebook 这个文件中我要做什么?我需要做什么?我对这部分很困惑。
编辑 我发现 this example but how make this logic with facebook without open a new pop up inside of amp's popup? (https://developers.facebook.com/docs/facebook-login/web) about this example, my login button just stay inside of amp popup... but my expected result is like this example here
Sign-in 和 amp-access 将始终打开一个新的弹出窗口。这是为了确保始终可以在您自己的来源上编写第一方 cookie,即使 AMP 页面是从 AMP 缓存提供的。