@Getter @Setter public class LoginUser extends org.springframework.security.core.userdetails.User{ private long userId; private String userName; // 他に保持したいプロパティがあれば追加 } public class CustomAuthenticationFilter extends UsernamePasswordAuthenticationFilter { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) { try { Principal principal = ne