简体   繁体   中英

Session management with Spring Boot?

I want to set up session management and authentication with Spring Boot. Specifically, when the user logs into my web application, they should be able to call my REST API to get data. Furthermore, after a certain period of time, they should be automatically logged out of the system at which point any REST calls should also fail. How can I accomplish this with Spring Boot ?

Spring Session takes care of distributed session management.

Spring Session provides an API and implementations for managing a user's session information. It also provides transparent integration with:

HttpSession - allows replacing the HttpSession in an application container (ie Tomcat) neutral way. Additional features include:

Clustered Sessions - Spring Session makes it trivial to support clustered sessions without being tied to an application container specific solution.

Multiple Browser Sessions - Spring Session supports managing multiple users' sessions in a single browser instance (ie multiple authenticated accounts similar to Google).

RESTful APIs - Spring Session allows providing session ids in headers to work with RESTful APIs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM