spartacus-与碱的api呼叫断路店面加载一起发送的令牌已过期
我们在使用CSR运行的Spartacus B2B 4.2遇到问题,并提早登录启用了OAuth代币到期并打开网站后,显示了一个空白页。
这里进行了模拟的方案:
- 用户登录,
- 然后,Spartacus将OAuth令牌存储在LocalStorage
- 用户中,关闭应用程序和/或浏览器
- 第二天,用户返回网站。
- spartacus呼叫basesites API,并随请求发送到期的最后
- 一个通话失败,spartacus无法弄清网站,没有渲染的内容 - 显示了空白页。
- 现在,如果用户刷新页面,则代币将不再发送,并且该页面被成功加载。
我们对项目的身份验证模块没有自定义。
一般信息:
- 这是Spartacus B2B App
- 版本4.2
- 运行CSR
- 早期登录已启用( https://sap.github.io/spartacus-docs/early-login/ )
我们确实有另一个spartacus b2c应用程序,运行相同的版本,但是使用SSR,但该错误并不是该错误。发生。
那么,我的问题是:
- 这是版本中的错误吗?
- 为什么Spartacus不利用Oauth在登录过程中返回的Oauth刷新代币?根据 https://sap.github.io/spartacus/spartacus-dococs/session-management-management-management /,“当请求失败后,因为访问令牌已过期,拦截器使用刷新令牌(如果存在的话)来请求新的访问令牌,然后使用新令牌重新检索失败的请求。 “
- 我们应该审查任何配置吗?
谢谢,
阿德里亚诺
We have an issue with Spartacus B2B 4.2 running with CSR and early login enabled that after the oauth token expires and user opens the website, a blank page is displayed.
Here goes the scenario to simulate:
- User logs in succesfully
- Then, Spartacus stores the oauth token in the localstorage
- User closes the application and/or the browser
- Next day, user returns to the website.
- Spartacus calls the basesites API and sends along with the request the expired token
- This last call fails, Spartacus cannot figure the website and nothing is rendered - blank page displayed.
- Now, if user refreshes the page, token is not longer sent and the page is loaded succesfully.
We don't have customizations to the authentication module in our project.
General information:
- This is Spartacus B2B App
- Version 4.2
- Running CSR
- Early login is enabled (https://sap.github.io/spartacus-docs/early-login/)
We do have another Spartacus B2C App, running same version, but with SSR, that the error doesn't happen.
So, my questions are:
- Is this a bug in the version?
- Why Spartacus is not leveraging OAuth Refresh token returned during the login process? According to https://sap.github.io/spartacus-docs/session-management/, "When a request fails because the access token has expired, the interceptor uses the refresh token (if it exists) to request a new access token, and then retries the failed request with the new token."
- Is there any configuration that we should review?
Thanks,
Adriano
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论