[英]How do I stop 3rd-party login flow from an iOS home screen PWA from opening in Safari?
I have a web app that handles user login using LinkedIn's OAuth API . 我有一个Web应用程序,使用LinkedIn的OAuth API处理用户登录。 The page redirects to LinkedIn's domain, then back to mine once the user has been authenticated.
页面重定向到LinkedIn的域,然后在用户通过身份验证后返回到我的域。 When my app is run after being added to the home screen on iOS via Safari, the LinkedIn authentication page opens in Safari, not in the home screen app.
当我的应用程序在通过Safari添加到iOS主屏幕后运行时,LinkedIn身份验证页面在Safari中打开,而不是在主屏幕应用程序中打开。
I take it this is because linkedin.com is outside the scope
property in my app's web manifest? 我认为这是因为linkedin.com在我的应用程序的Web清单中的
scope
属性之外?
Does anyone have a solution to keep an entire cross-domain login flow like this within the home screen app? 有没有人有解决方案在主屏幕应用程序中保持这样的整个跨域登录流程? I'm also trying to figure out if this behavior is within the spirit of the spec (or if such behavior is undefined).
我也试图弄清楚这种行为是否符合规范的精神(或者这种行为是否未定义)。
It looks like there is precedence for cross-domain redirects being contained within the home screen app in Chrome on Android: 在Android上的Chrome主屏幕应用中包含跨域重定向似乎优先:
https://bugs.chromium.org/p/chromium/issues/detail?id=771418 https://bugs.chromium.org/p/chromium/issues/detail?id=771418
Standalone PWA breaks login 独立PWA中断登录
You can see the behavior by trying the LinkedIn login at fizzr.io after adding the landing page to the home screen on iOS. 在将登录页面添加到iOS主屏幕后,您可以通过尝试在fizzr.io上登录LinkedIn来查看该行为。 Just tapping the LinkedIn button will open the login flow externally in Safari.
只需点击LinkedIn按钮即可在Safari外部打开登录流程。
Here's my app manifest: 这是我的应用清单:
{
"name": "fizzr.io",
"short_name": "fizzr.io",
"icons": [
{
"src": "app-icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "app-icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone",
"start_url": "/",
"scope": "/"
}
我相信现在已经修复了iOS 12.2 Beta 1上的Safari: https : //twitter.com/tomayac/status/1089819735292866560
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.