Web应用程序会话超时使用Spring Security OAuth2身份验证
我在Java Spring服务器上有一个网络应用程序,该服务器为React客户端提供服务。 我将Spring Security OAuth2用于用户身份验证(使用Auth0)。
我想确保在15分钟后记录闲置会议。
我已经阅读了一些特定的技术配置选项,例如:
- 春季会话超时属性
- JWT Lifetime
- 刷新令牌,
但我没有看到任何完整的解决方案说明。
达到这一要求的最佳实践是什么?
I have a web-application on Java Spring server which serves a react client.
I use spring security OAuth2 for user authentication (using Auth0).
I want to make sure that idle sessions are logged out after 15 minutes.
I've read about some specific technical configuration options like:
- spring session timeout property
- JWT lifetime
- refresh tokens
But I didn't see any complete solution explanation.
What are the best practices to achieve this requirement?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于,如果您使用春季会话,则可以使用此属性
spring.session.timeout
或者如果不是,则可以将server.servlet.session.session.timeout
用于Servlet应用程序。还可以从文档,在该属性上进行解释,您设置持续时间后缀,或者如果没有,则使用秒。
设置该属性将在您在会话空闲时在弹簧后端指定的时间上超出会话。
It depends, if you use Spring Session you can use this property
spring.session.timeout
or if not then you could useserver.servlet.session.timeout
for a servlet application.Also paraphrasing from the docs, on that property, you set the duration suffix or if not it will use seconds.
Setting that property will timeout the session on the time that you specified on the Spring backend when the session is idle.