åã®è¨äºã®ç¶ããç¬èªã®ã¦ã¼ã¶ãã¼ãã«ã使ã£ãæã«ã¯ããã¹ã¯ã¼ãã¨ã³ã³ã¼ããããï¼
wannabe-jellyfish.hatenablog.com
Before: ãã¹ã¯ã¼ãã¨ã³ã³ã¼ããªã
@Configuration public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private UserInfoService userInfoService; (ä¸ç¥) @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userInfoService); } }
After: ãã¹ã¯ã¼ãã¨ã³ã³ã¼ããã
@Configuration public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private UserInfoService userInfoService; (ä¸ç¥) @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider(); authProvider.setUserDetailsService(userInfoService); authProvider.setPasswordEncoder(new BCryptPasswordEncoder()); auth.authenticationProvider(authProvider); } }
ã¡ãªã¿ã«ãBCryptã§ã¨ã³ã³ã¼ãããæ¹æ³ã¯ä»¥ä¸ã®éãã
DBã¸è¿½å ããã¨ãã¯ãå¤æãã¦ããæå ¥ããã°OK
String encodedPassword = BCrypt.hashpw(rawPassword, BCrypt.gensalt());
以ä¸ï¼
åèã«ãªãæ¸ç±
Springå¾¹åºå ¥é Spring Frameworkã«ããJavaã¢ããªã±ã¼ã·ã§ã³éçº
- ä½è : æ ªå¼ä¼ç¤¾NTTãã¼ã¿
- åºç社/ã¡ã¼ã«ã¼: ç¿æ³³ç¤¾
- çºå£²æ¥: 2016/07/21
- ã¡ãã£ã¢: 大åæ¬
- ãã®ååãå«ãããã° (1件) ãè¦ã
Spring Framework 5 ããã°ã©ãã³ã°å ¥é
- ä½è : æç°æ´¥è¶ä¹
- åºç社/ã¡ã¼ã«ã¼: ç§åã·ã¹ãã
- çºå£²æ¥: 2017/12/20
- ã¡ãã£ã¢: åè¡æ¬
- ãã®ååãå«ãããã°ãè¦ã
Spring Boot 2 ããã°ã©ãã³ã°å ¥é
- ä½è : æç°æ´¥è¶ä¹
- åºç社/ã¡ã¼ã«ã¼: ç§åã·ã¹ãã
- çºå£²æ¥: 2018/01/30
- ã¡ãã£ã¢: åè¡æ¬
- ãã®ååãå«ãããã°ãè¦ã
- ä½è : æ§ä¿æ
- åºç社/ã¡ã¼ã«ã¼: å·¥å¦ç¤¾
- çºå£²æ¥: 2016/09/01
- ã¡ãã£ã¢: åè¡æ¬
- ãã®ååãå«ãããã° (1件) ãè¦ã