feat: 유저 저장 확인 위해 h2 관련 설정
This commit is contained in:
@@ -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'
|
||||
}
|
||||
|
||||
|
||||
@@ -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 인터페이스 구현체 등록
|
||||
}
|
||||
|
||||
@@ -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
|
||||
3
src/main/resources/static/index.html
Normal file
3
src/main/resources/static/index.html
Normal 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>
|
||||
Reference in New Issue
Block a user