Bcrypt Custom password configuration

前端 未结 2 999
南方客
南方客 2021-01-29 10:37

i am changing the password and then forwarding to /loginuser and redirect to users dashboard. i had secured this with httpbasic authentication since i am a beginner, I am using

2条回答
  •  花落未央
    2021-01-29 11:30

    @Autowired
        DataSource dataSource;
    
        @Bean
        public PasswordEncoder passwordEncoder()
        {
            return new BCryptPasswordEncoder();
        }
    
        @Override
        protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    
            auth.jdbcAuthentication().dataSource(dataSource).passwordEncoder(passwordEncoder());
        }
    

提交回复
热议问题