- 페이스북, 구글 로그인 및 기본 시큐리티 연동
![blog](https://camo.githubusercontent.com/f95ccc5f86de370170ed19c68889c0a53f82ce8556e45e575fb605065f6530bb/68747470733a2f2f706f737466696c65732e707374617469632e6e65742f4d6a41794d4441344d4452664d5455312f4d4441784e546b324e5441324f4441794d5467782e516f666636465131524a79477738336d6575445854354a35652d4163315777534a4d48327766316c315377672e4b696e566550587164554f65794459595270346167757754737846304f42514236344c4e5559544a525267672e504e472e676574696e74686572652f53637265656e73686f745f32362e706e673f747970653d77373733)
Naver, Google, Facebook 로그인 완료
![blog](https://camo.githubusercontent.com/765dd2b43a97cd7a084dc6c7a716c03035145a8af2189ae807e2268b3fe96713/68747470733a2f2f706f737466696c65732e707374617469632e6e65742f4d6a41794d4441344d4452664d54677a2f4d4441784e546b324e54457a4f4451334d444d7a2e326e4270493643473633455a73666a59436a58303861554836504d35354a555a5a6c74446c326270527077672e52396c3451476737477a6f4831785471655254426c6568462d396c666952315f62715a74382d355863326b672e504e472e676574696e74686572652f53637265656e73686f745f32372e706e673f747970653d77373733)
server:
port: 8080
servlet:
context-path: /
encoding:
charset: UTF-8
enabled: true
force: true
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/security?serverTimezone=Asia/Seoul
username: cos
password: cos1234
mvc:
view:
prefix: /templates/
suffix: .mustache
jpa:
hibernate:
ddl-auto: update #create update none
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
show-sql: true
security:
oauth2:
client:
registration:
google: # /oauth2/authorization/google 이 주소를 동작하게 한다.
client-id: 머시기
client-secret: 머시기
scope:
- email
- profile
facebook:
client-id: 머시기
client-secret: 머시기
scope:
- email
- public_profile
# 네이버는 OAuth2.0 공식 지원대상이 아니라서 provider 설정이 필요하다.
# 요청주소도 다르고, 응답 데이터도 다르기 때문이다.
naver:
client-id: 머시기
client-secret: 머시기
scope:
- name
- email
- profile_image
client-name: Naver # 클라이언트 네임은 구글 페이스북도 대문자로 시작하더라.
authorization-grant-type: authorization_code
redirect-uri: http://localhost:8080/login/oauth2/code/naver
provider:
naver:
authorization-uri: https://nid.naver.com/oauth2.0/authorize
token-uri: https://nid.naver.com/oauth2.0/token
user-info-uri: https://openapi.naver.com/v1/nid/me
user-name-attribute: response # 회원정보를 json의 response 키값으로 리턴해줌.