之前工做用的登录服务也不接SpringSecurity,因此这里写篇博客记录一下。使用SpringBoot接入SpringSecurity,咱们先加入一些简单的依赖:spring
其中用的springBoot的版本是:安全
而后咱们写一个SpringSecurity的配置:ui
authorizeRequests()定义哪些URL须要被保护、哪些不须要被保护
configureGlobal(AuthenticationManagerBuilder auth)方法,在内存中建立了一个用户,这里须要设置CustomPasswordEncoder()。code