简体   繁体   English

如何在Safari中打开来自iOS主屏幕PWA的第三方登录流程?

[英]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.

相关问题 第三方iOS SDK? - 3rd-party iOS SDKs? 如何在添加到主屏幕后停止加载缓存页面的iOS Safari网页? - How to STOP iOS Safari web page from loading cached pages after adding to home screen? iOS如何管理需要第三方框架的不同功能 - iOS How to manage different features that requires a 3rd-party framework 如何将 3rd-Party 框架添加到 Delphi iOS 项目? - How to add 3rd-Party Framework to Delphi iOS Project? 使用第三方应用程序打开Uber应用程序,然后再回到iOS上的第三方应用程序的可能性 - Possibility of using 3rd-party app to open Uber app then going back to 3rd-party app on iOS 如何阻止 ColdFusion 目标在 Safari 中打开? - How to Stop ColdFusion Targets from Opening in Safari? 如果需要修改源代码才能使用iOS项目中的第三方库,该如何管理? - How to manage 3rd-party library in iOS project if its source code needs to be modified in order to be used? 如何在内部分发使用Adobe Air制作的第三方iOS应用 - How to distribute 3rd-party iOS apps made with Adobe Air in-house 如何通过主屏幕上的点击图标获取iOS App启动事件? - How do I get the iOS App launch event by clicked icon from home screen? 当用户点击应用中的任何链接时,如何阻止我的ios应用打开网址? - How do i stop my ios app from opening a url when user taps on any link in the app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM