Class SpringSecurityJAASConfiguration

java.lang.Object
javax.security.auth.login.Configuration
io.hawt.springboot.security.SpringSecurityJAASConfiguration

public class SpringSecurityJAASConfiguration extends Configuration

JAAS Configuration that integrates with Spring Security. It includes two login modules with particular responsibilities:

  1. Spring Security SecurityContextLoginModule which turns existing (required) org.springframework.security.core.Authentication object into JAAS Principal and sets it as the only principal of JAAS Subject
  2. Hawtio HawtioSpringSecurityLoginModule which examines already authenticated Subject and extracts granted roles in Spring Security Authentication and sets them as additional principals of the subject. The role class is taken from first available class of rolePrincipalClasses Hawtio property.

This configuration will only be used if Spring Security is properly configured and hawtio-springboot-security is available on the classpath.