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