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

查看:30
本文介绍了独立 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 中安装它时,我们会获得本机应用程序的外观和感觉(没有浏览器 chrome、启动画面等),但登录会中断.

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.

我所期望的是第二次重定向将返回到我的 PWA 而不使用 web-view chrome.

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天全站免登陆