Browse Source

Enable BCryptPasswordEncoder

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.3-alpha
Pekka Helenius 4 years ago
parent
commit
13fd73a09e
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      bookstore/src/main/java/com/fjordtek/bookstore/config/WebSecurityConfig.java

+ 4
- 3
bookstore/src/main/java/com/fjordtek/bookstore/config/WebSecurityConfig.java View File

@ -4,6 +4,7 @@ package com.fjordtek.bookstore.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
@ -13,6 +14,7 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import com.fjordtek.bookstore.service.session.BookStoreAccessDeniedHandler;
import com.fjordtek.bookstore.service.session.BookStoreAuthenticationFailureHandler;
@ -54,16 +56,15 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
public void configureGlobal(AuthenticationManagerBuilder authManagerBuilder)
throws Exception {
authManagerBuilder.userDetailsService(userDetailService)
// .passwordEncoder(bCryptPasswordEncoder)
.passwordEncoder(bCryptPasswordEncoder())
;
}
/*
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder() {
return new BCryptPasswordEncoder();
}
*/
/*
* Have different HTTP security policies for:


Loading…
Cancel
Save