Spring Security with JAAS
In Chapter 1, Basic Security, we have already demonstrated how to use JAAS configuration in JBOSS for authentication and authorization. Spring Security also provides a full support to implement JAAS-based authentication. We need to configure DefaultJaasAuthenticationProvider
as the authentication provider. In this section, we will demonstrate integration of Spring Security with JAAS.
Let us see some of the JAAS-based classes and interfaces offered by Spring Security APIs:
org.springframework.security.authentication.jaas
AbstractJaasAuthenticationProvider
AuthorityGranter
DefaultJaasAuthenticationProvider
DefaultLoginExceptionResolver
JaasAuthenticationCallbackHandler
JaasAuthenticationToken
JaasGrantedAuthority
JaasNameCallbackHandler
LoginExceptionResolver
SecurityContextLoginModule
Getting ready
- Implement the
AuthorityGranter
interface byorg.springframework.security.authentication.jaas.AuthorityGranter
- Implement the
LoginModule
interface byjavax.security.auth.spi.LoginModule...