These are chat archives for alvarosanchez/spring-security-rest

25th
Nov 2014
Álvaro Sánchez-Mariscal
@alvarosanchez
Nov 25 2014 07:58
@nikuelias assuming you are using GORM for storing users, you can subclass DaoAuthenticationProvider
eg
class ExpiringUsersAuthenticationProvider extends DaoAuthenticationProvider
and then override additionalAuthenticationChecks()
void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException {
    super.additionalAuthenticationChecks(userDetails, authentication)

    //... your code ...
}
finally, you have to register the bean in resources.groovy
Álvaro Sánchez-Mariscal
@alvarosanchez
Nov 25 2014 08:08
        daoAuthenticationProvider(ExpiringUsersAuthenticationProvider) {
            userDetailsService = ref('userDetailsService')
            passwordEncoder = ref('passwordEncoder')
            userCache = ref('userCache')
            saltSource = ref('saltSource')
            preAuthenticationChecks = ref('preAuthenticationChecks')
            postAuthenticationChecks = ref('postAuthenticationChecks')
            authoritiesMapper = ref('authoritiesMapper')
            hideUserNotFoundExceptions = SpringSecurityUtils.securityConfig.dao.hideUserNotFoundExceptions // true
        }
Álvaro Sánchez-Mariscal
@alvarosanchez
Nov 25 2014 10:45
@sbrady let me have a closer look
nikuelias
@nikuelias
Nov 25 2014 13:19
Thanks a lot @alvarosanchez i will try and give an update to you!