Azuread身份验证 - 无状态(Spring Boot Java)

发布于 2025-02-04 21:22:40 字数 580 浏览 1 评论 0原文

我有一个带有AAD身份验证的项目,一切正常,直到我将以下代码添加到我的Httpsecurity配置

    http
                    .sessionManagement()
                    .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                    .and();

应用程序中开始要求在无休止的周期中一次又一次登录。

如果我删除了代码的那部分 - 该应用程序可以按预期工作,但是有些问题。
看起来Swagger从应用程序中读取缓存的授权,而Swagger注销按钮没有效果。 (还可以从Swagger登录中读取缓存的授权)

该属性中的此字符串没有效果。

spring.cloud.azure.active-directory.sessions-stateless=true

有什么办法可以将应用程序的工作和Swagger分开 - 因此它们不会互相干扰授权? 谢谢。

I have a project with AAD authentication, everything works fine until I add the following code to my HttpSecurity config

    http
                    .sessionManagement()
                    .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                    .and();

Application starts asking to login again and again in endless cycle.

If I remove that part of code - the app works as expected but there are issues with swagger.
Looks like swagger reads cached authorization from the app, and swagger logout button does no effect. (also app can read cached authorization from swagger login)

This string in properties has no effect.

spring.cloud.azure.active-directory.sessions-stateless=true

Is there any way to separate work of the app and swagger - so they do not interfere each other authorization?
Thx.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文