Spring Security

@Log4j2
public class MyAuthenticationFilter extends UsernamePasswordAuthenticationFilter {
    @Override
    public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) {
        
        String username = obtainUsername(request);  
        String password = obtainPassword(request);
        log.info("loginfilter: "+username+" "+password);
        
        // トークンの作成
        final UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(
                username, password);
        // Allow subclasses to set the "details" property
        setDetails(request, authRequest);
        
        return this.getAuthenticationManager().authenticate(authRequest);      //nullが返ってる
        }
        
        @Autowired
        public void setAuthenticationManager(AuthenticationManager authenticationManager) {
            super.setAuthenticationManager(authenticationManager);
        }
        
}

http://wannabe-jellyfish.hatenablog.com/entry/2018/01/10/013508 https://teratail.com/questions/94735

https://teratail.com/questions/95922

https://fueiseix.hatenablog.com/entry/2018/03/11/191200

https://terasolunaorg.github.io/guideline/5.1.0.RELEASE/ja/Security/Authentication.html

https://terasolunaorg.github.io/guideline/public_review/Security/Authentication.html#usernamepasswordauthenticationtoken

https://github.com/spring-projects/spring-security/blob/master/web/src/main/java/org/springframework/security/web/authentication/UsernamePasswordAuthenticationFilter.java

https://github.com/spring-projects/spring-security/blob/master/core/src/main/java/org/springframework/security/authentication/UsernamePasswordAuthenticationToken.java

https://github.com/spring-projects/spring-security/blob/master/core/src/main/java/org/springframework/security/authentication/AbstractAuthenticationToken.java

作成中...