reactjs - MSAL 以静默方式获取令牌在 IE 11 for React SPA 中不起作用
问题描述
为了支持 IE 11,我包括以下内容:
import 'react-app-polyfill/ie11';
还禁用了保护模式以便在本地运行应用程序(参考Microsoft 的文档)
现在我可以登录并执行操作,但是静默获取令牌不起作用。我使用本地存储作为 cacheLocation 并且还发现所有内容都存储在本地存储中。但是,每当我尝试静默获取令牌时,都会出现错误。成功登录后,如果我关闭浏览器并在 IE 11 中重新打开应用程序,那么我希望我的应用程序将静默获取令牌,但它永远不会在 IE 11 中发生(在 chrome 和 edge 中工作正常)。它总是无法以静默方式获取令牌,并出现以下错误:
InteractionRequiredAuthError: Silent authentication was denied. The user must first sign in and if needed grant the client application access to the scope 'user.read openid profile'.
在浏览器控制台中,我收到另一个错误:
Error occurred in token received callback function. TypeError: Object expected.
这两个错误都只发生在 IE 11 中,并且在 chrome/edge 中完美运行。
解决方案
推荐阅读
- c# - Dynamics 365 插件不发送电子邮件 C#
- sql - 组合/加入 SQL 查询
- flask - Flask - 模板、路由和 HTML
- kotlin - 在 Kotlin 中删除和检索 MutableSet 的元素
- java - 如何在 1 周后准确处理来自分布式日志代理(例如 Kafka)的日志?
- amazon-web-services - dynamodb 中不同属性的并发更新
- java - Maven Surefire 插件不会尝试运行 JUnit 5 测试
- python - 返回元素后如何正确关闭 Selinium Web 驱动程序?
- java - 尝试从 JAWT_DrawingSurface 获取锁定时出现 JAWT_LOCK_ERROR
- python - scipy.fft.fft 输出行为与 T/f_signal 比率