feat: 유저 저장 확인 위해 h2 관련 설정

This commit is contained in:
kimjunseo
2021-07-23 02:24:31 +09:00
parent a636e5694b
commit cb3d94ed6a
4 changed files with 16 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'com.h2database:h2'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

View File

@@ -17,7 +17,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.oauth2Login() // OAuth2 로그인 설정 시작점
http.csrf().disable()
.headers().frameOptions().disable()
.and()
.oauth2Login() // OAuth2 로그인 설정 시작점
.userInfoEndpoint() // OAuth2 로그인 성공 이후 사용자 정보를 가져올 때 설정 담당
.userService(oAuthService); // OAuth2 로그인 성공 시, 후작업을 진행할 UserService 인터페이스 구현체 등록
}

View File

@@ -1,3 +1,10 @@
spring:
profiles:
include: oauth
include: "oauth"
datasource:
url: "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"
name: "sa"
password:
h2:
console:
enabled: true

View File

@@ -0,0 +1,3 @@
<a href="/oauth2/authorization/github">Github Login</a><br>
<a href="/oauth2/authorization/google">Google Login</a><br>
<a href="/oauth2/authorization/naver">Naver Login</a><br>