Spring Boot ã§æ¸ç±ã®è²¸åºç¶æ³ç¢ºèªã»è²¸åºç³è«ãã Web ã¢ããªã±ã¼ã·ã§ã³ãä½ã ( çªå¤ç·¨ )( æå®ããããã±ã¼ã¸é ä¸ã®ã¯ã©ã¹ããã¤ã¢ã°ã©ã ã§è¡¨ç¤ºãã )
ã¯ããã«
IntelliJ IDEA Ultimate Edition ã§æå®ããããã±ã¼ã¸ ( å¤é¨ã©ã¤ãã©ãªã§ãå¯ ) é ä¸ã®ã¯ã©ã¹ããã¤ã¢ã°ã©ã ã§è¡¨ç¤ºããæ¹æ³ã調ã¹ãã®ã§ããã®æé ãè¨è¼ãã¾ããç¹å®ã¯ã©ã¹ãç¶æ¿ãã¦ããã¯ã©ã¹ã調æ»ãããæã«ã使ãã¾ãã
Spring Security ã®ããã±ã¼ã¸ org.springframework.security é ä¸ã« ApplicationEvent ãç¶æ¿ããã¯ã©ã¹ã¨ãã¦ä½ãããã®ãã調ã¹ããã¨æã£ãã®ã調æ»ããçºç«¯ã§ãã
æå®ããããã±ã¼ã¸é ä¸ã®ã¯ã©ã¹ããã¤ã¢ã°ã©ã ã§è¡¨ç¤ºãã
-
org.springframework.security
ã package ã import ã«æ¸ããã¦ããã½ã¼ã¹ãã¡ã¤ã«ãéãã¾ããä»å㯠src/main/java/ksbysample/webapp/lending/security ã®ä¸ã® AuthenticationFailureBadCredentialsEventListener.java ãéãã¾ãã ã½ã¼ã¹ãã¡ã¤ã«ã®ä¸é¨ã®
import org.springframework.security.authentication.event.AuthenticationFailureBadCredentialsEvent;
ã®security
ã«ã«ã¼ã½ã«ã移åããå¾ãã³ã³ããã¹ãã¡ãã¥ã¼ã表示ãã¦ãDiagramsã->ãShow Diagram...ããé¸æãã¾ããæå®ããããã±ã¼ã¸å ã®ããã±ã¼ã¸ã®ãã¤ã¢ãã°ã表示ããã¾ãã
Ctrl+A ãæ¼ãã¦è¡¨ç¤ºããã¦ããå ¨ã¦ã®ããã±ã¼ã¸ãé¸æããå¾ãã³ã³ããã¹ãã¡ãã¥ã¼ã表示ãã¦ãExpand Nodesããé¸æãã¾ãã
ããã±ã¼ã¸ãå±éããã¦ããã®ããã±ã¼ã¸ç´ä¸ã«ããã¯ã©ã¹ããã¤ã¢ã°ã©ã å ã«è¡¨ç¤ºããã¾ãã
ã¾ã ãã¤ã¢ã°ã©ã å ã«ããã±ã¼ã¸ãæ®ã£ã¦ãã¾ãã®ã§ãCtrl+A ã§å ¨é¸æ â ãExpand Nodesããããã±ã¼ã¸ããªããªãã¾ã§ç¹°ãè¿ãã¾ãã
ããã±ã¼ã¸ããªããªã£ãã ãã®æ®µéã§ã¯ãã¾ã ApplicationEvent ããã¤ã¢ãã°ã«è¡¨ç¤ºããã¦ãã¾ãããApplicationEvent ããã¤ã¢ã°ã©ã ã«è¡¨ç¤ºãã¾ãã
Ctrl+F ãæ¼ãã¦æ¤ç´¢ã¦ã£ã³ãã¦ãéããå¾ã"Event" ã¨å ¥åãã¦ã¯ã©ã¹åã« "Event" ã®æååãå«ã¾ããã¯ã©ã¹ã表示ãã¾ãã表示ãããã¯ã©ã¹ãã AuthenticationSuccessEvent ãé¸æãã¾ãã
ãã¤ã¢ã°ã©ã ã® AuthenticationSuccessEvent ã表示ããã¦ããä½ç½®ã«ã¸ã£ã³ããã¾ããAuthenticationSuccessEvent ç¶æ¿å ã®ã¯ã©ã¹ AbstractAuthenticationEvent ãé¸æããå¾ãã³ã³ããã¹ãã¡ãã¥ã¼ã表示ãã¦ãShow Parentsããé¸æãã¾ãã
ãSuper classes for AbstractAuthenticationEventãã¨ããã¦ã£ã³ãã¦ã表示ããã¾ããã¦ã£ã³ãã¦å ã®ãªã¹ããã ApplicationEvent ãé¸æãã¾ãã
ãã¤ã¢ãã°ã« ApplicationEvent ã表示ããã¾ãããè¦ã¦ããç»é¢ä¸ã«è¦å½ããã¾ãããCtrl+F ãæ¼ãã¦æ¤ç´¢ã¦ã£ã³ãã¦ãéããå¾ã"ApplicationEvent" ã¨å ¥åãã¦ãããªã¹ãã«è¡¨ç¤ºããã ApplicationEvent ãé¸æãã¾ãã
ãã¤ã¢ã°ã©ã ã® ApplicationEvent ã表示ããã¦ããä½ç½®ã«ã¸ã£ã³ããã¾ãããã㧠ApplicationEvent ãç¶æ¿ãã¦ããã¯ã©ã¹ã確èªãããã¨ãã§ãã¾ãã