расширение AuthenticationProcessingFilter
переопределить
@Override
protected void onSuccessfulAuthentication(HttpServletRequest request,
HttpServletResponse response, Authentication authResult)
throws IOException {
и здесь вы можете делать то, что хотите, сохраняя переменную приложения.