I am using a working JWT authentication of my web application with the following configuration:
@Override
protected void configure(HttpSecurity http) throws
Your current configuration (sessionCreationPolicy(SessionCreationPolicy.STATELESS)
) ensures that Spring-Security (and only Spring-Security)
Principal
).Any other component of your application (for example, if you would use Spring-Session) is still free to create the session.
Try to set the session to none in the application.yml:
spring.session.store-type=none
as mentioned in the docs: https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-session.html