Skip to content

Commit

Permalink
[FEATURE] E4-S3 회원가입 API - 스프링시큐리티에 userdetail설정 #25
Browse files Browse the repository at this point in the history
  • Loading branch information
choisungwook committed Oct 8, 2021
1 parent 5c3200b commit 2e4f600
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.infp.ciat.config.security;

import com.infp.ciat.user.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
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;
Expand All @@ -14,6 +17,9 @@
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private AccountService customUserDetailService;

/***
* default 패스워드 암호화알고리즘 사용 설정
* @return
Expand Down Expand Up @@ -44,4 +50,14 @@ protected void configure(HttpSecurity http) throws Exception {
.and()
.csrf().disable();
}

/***
* 사용자 userdetailservice 등록
* @param auth
* @throws Exception
*/
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(customUserDetailService);
}
}

0 comments on commit 2e4f600

Please sign in to comment.