独立PWA中断登录 [英] Standalone PWA breaks login

查看:115
本文介绍了独立PWA中断登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个用Angular编写的PWA,我们使用AzureAD(使用ng-adal)进行登录.

We have a PWA written in Angular for which we use AzureAD (using ng-adal) for the login.

当我们登录时,将进行一系列重定向,直到返回到我们的应用程序(带有身份验证票证)为止.如果我们将"manifest.json"配置为display:browser,一切都会按预期进行.如果我们将其设置为display:standalone,则会出现问题.这样,当我们在Android中安装它时,我们得到了本机应用程序的外观(没有浏览器镶边,初始屏幕等),但登录中断.

When we log in, a series of redirects are being made until we get back to our app (with the auth ticket). If we configure the "manifest.json" to display:browser, everything works as expected. The problem comes if we set it up as display:standalone. This way, when we install it in Android we get the look and feel of a native app (no browser chrome, splash screen,...) but the login breaks.

我们得到的效果是,AzureAD页面在浏览器视图中打开(预期),但是到我们页面的重定向仍在浏览器视图中(在左上角带有X按钮).在此浏览器视图"中,我们已通过身份验证,但如果使用X按钮,则该视图将关闭,然后返回到PWA,但未经过身份验证.

The effect we get is that the AzureAD page opens in a browser view (expected), but the redirection to our page is still on the browser view (with an X button in the to left corner). In this "browser view" we are authenticated, but if we use the X button, this view is closed and we go back to the PWA but remain unauthenticated.

有什么可能的想法吗?

谢谢!

添加了快速示例(这是对另一件事的测试).

Added a quick example (it's a test for another thing).

右上角的图标重定向到另一个域,该域又重定向回到此页面.如果将应用程序添加到Android主屏幕(由于我尚未完全配置PWA清单,但未添加所有图标,但效果可查看),我们看到单击该图标,将打开一个Web视图转到第一个重定向,但对于第二个重定向保持打开状态.

The icon at the top right corner redirects to another domain which redirects back to this page. If we add the app to an Android home screen (it does not add all the icons as I have not configured the PWA manifest completely, but the effect is view-able), we see that clicking on the icon, a web view opens to go to the first redirect but remains open for the second redirect back.

我希望第二次重定向将返回到没有Web视图镶边的PWA.

What I would expect is that the second redirect will goback to my PWA without the web-view chrome.

推荐答案

当前已通过最新版本的Chrome(r67)修复.

This is now fixed with the latest version of Chrome (r67).

这篇关于独立PWA中断登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆