Session Management with Spring

I want to configure session management and authentication using Spring Boot. In particular, when a user logs into my web application, they should be able to call my REST API to retrieve data. In addition, after a certain period of time, they should automatically log out of the system, after which any REST calls should also be interrupted. How can I accomplish this with Spring Boot?

+11
source share
3 answers

You can use Spring Session works well with spring boot

Docs: http://docs.spring.io/spring-session/docs/current/reference/html5/

Spring Session provides APIs and implementations for managing user session information. It also provides transparent integration with:

HttpSession - allows you to replace HttpSession in the application container (i.e. Tomcat) in a neutral way. Additional functions:

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

Multiple browser sessions - spring Session supports managing multiple users' sessions in a single browser instance (i.e. multiple authenticated Google-like accounts).

RESTful API - spring Session allows you to provide session identifiers in headers for working with RESTful API

+12
source
0
source

This good video explains why the Spring Boot session works and how to implement server access for multiple users. https://www.youtube.com/watch?v=7e5R7FetJnc

0
source

Source: https://habr.com/ru/post/1263821/


All Articles