5. • spring-social
• 4 Main Projects
• 2 Incubator Projects
• 35 Community Projects
6. “Why has Spring Security 5 introduced new support into the mix?”
“Which project(s) do I use?”
7. • OAuth 2.0 지원을 하나의 프로젝트로 통합할 필요가 있다.
• OAuth 2.0 확장 스펙을 지원할 수 있어야 한다.
- OAuth2 Assertions (RFC-7521) , SAML2 Bearer Assertion (RFC-7522) , JWT Bearer Assertion (RFC-7523)
• OpenID Connect 1.0 / JOSE 스펙을 지원한다.
• 커뮤니티 피드백을 기반으로 사용 편의성을 개선한다.
• Documentation 을 자세히 제공할 필요가 있다.
Next Generation OAuth 2.0 Goal
8. • spring-security-oauth2-client : 5.0.0 (2017.11)
• spring-security-oauth2-jose : 5.0.0 (2017.11)
• spring-security-oauth2-resource-server : 5.1.0 (2018.09 예정)
• spring-security-oauth2-authorization-server: (2019 초 예정)
The Plan Forward
13. * spring-security-oauth2-boot (support for spring boot 1.5.x)
+ Spring Boot properties base AutoConfiguration
+ @EnableOAuth2Sso
+ UserInfoTokenService
+ Spring Social support
+ Customizers
- JwtAccessTokenConverterRestTemplateCustomizer
- UserInfoRestTemplateCustomizer
- PrincipalExtractor
- AuthoritiesExtractor
14. * spring-cloud-security
+ AccessTokenContextRelay
+ OAuth2LoadBalancerClient (UserInfo)
+ OAuth2FeignRequestInterceptor
+ OAuth2TokenRelayFilter (ZuulFilter)
- proxy.auth.routes.{service-name}: oauth2 # OAuth2 인증 후 AccessToken 을 서비스에 전달
- proxy.auth.routes.{service-name}: passthru # Authorization header 를 그대로 서비스에 전달
- proxy.auth.routes.{service-name}: none # Authorization header 를 제거한 후 서비스에 전달
17. * spring-social
• social API SDK 제공 (facebook, twitter, linkedin ..)
• 각 social 별 인증 방식 최적화 및 API 구현
• Spring Boot 1.5.x 에서 spring security oauth 와 연동
지원 (SpringSocialTokenServices)
• Projects in the Attic 으로 밀려나면서 업데이트 거의 없
음 (2017.11 이후 커밋 거의 없음)
• spring-social-facebook deprecated 된 버전 지원 중
26. 1. spring-security-oauth 프로젝트는 maintenance mode 로 변경
2. spring-boot 2.x 에서 spring security 5.x oauth2를 기본 모듈로 지원
3. spring-security-oauth 에서 삽질 및 고생을 많이 함..
4. spring security 5.x oauth2 의 인터페이스 설계가 괜찮아 보임
왜?
28. spring-security-oauth 에 고통 받는 이유
1. spring-security 도 어려운데 spring-security-oauth는 더 어려움
2. client, authorization-server, resource-server 의 설정 경계가 모호함
3. 어노테이션 기반의 설정은 기본적인 프로세스만 제공
4. 실제 서비스에서는 다양하고 복잡한 처리가 요구됨
5. 확장 포인트가 적절히 오픈 되어 있지 않다.
6. SSO, Customizer 등은 boot 프로젝트에 위치하고, 충분치 않음.
7. 결국 직접 상속/Override 하여, 재구성 (이럴바엔 직접 구현하는게 나을지도..)
29. spring security 5.0.0 oauth 2.0
1. client registration, provider 의 설정 구분이 명확함.
2. 확장이 필요한 기능 인터페이스와 Java Config 제공.
3. Redirect 와 Authentication프로세스가 분리 관리됨.
4. 디테일한 포인트에 확장이 아직 제공되지 않음.
5. 아직 구현되지 않은 Spec 이 많음.
6. AuthorizationServer, ResourceServer 는 아직 개발되지 않음.
7. 버그가 심심찮게 나옴
8. 개선했어도 어렵다. (spring security, OAuth 2.0 스펙 본연의 복잡함)
9. Migration 실패
31. Contribution 1. Java Config NPE bug fix
- Java Config 에서 loginProcissingUrl 설정 시 NPE bug fix
https://github.com/spring-projects/spring-security/pull/5489
32. Contribution 2. OAuth2AccessToken serialize exception fix
- OAuth2AccessToken 을 serialize 할 때 exception 이 발생하는 bug fix
https://github.com/spring-projects/spring-security/pull/5493
33. Contribution 3. ClientRegistration scope can be null.
- ClientRegistration 설정 시 scope 이 null 값이 될 수 있도록 수정 (RFC-6749)
https://github.com/spring-projects/spring-security/pull/5495
34. Contribution 4/5. baseUrl exclude queryString
- RequestUri 기반으로 baseUrl 을 추출할 때 requestUri 에서 queryString 제거
https://github.com/spring-projects/spring-security/pull/5522
https://github.com/spring-projects/spring-security/pull/5559
35. Contribution 6. Polish Javadoc to remove warning
https://github.com/spring-projects/spring-security/pull/5505
37. Contribution 8. spring boot configuration
https://github.com/spring-projects/spring-boot/pull/13865
38. Issue and Solution : Support X-Forwarded-* Header
https://github.com/spring-projects/spring-security/issues/5535
39. Issue and Solution : PrincipalExtractor for username
https://github.com/spring-projects/spring-security/issues/5526
40. Issue and Solution : OAuth2AuthorizationRequestResolver Customizer
https://github.com/spring-projects/spring-security/issues/5525
41. Reject but apply later :
Refactor OAuth2AuthorizationRequestResolver interface api
https://github.com/spring-projects/spring-security/issues/5554
Reject Apply later
42. - 5.1.0-SNAPSHOT 기준으로 마이그레이션 성공
- 5.1.0-RELEASE 발표되면, 운영 중인 실 서비스 전환 예정 (2018.09.21예정)
43. Spring 기반의 OAuth 2.0 구현을 준비한다면…
1. spring-social 은 선택하지 않기를 권장.
2. AuthorizationServer, ResourceServer 는 spring security 5.x 현재 미구현.
3. AuthorizationServer, ResourceServer 까지 구현/안정화되면전환을 권장.
4. spring security 5.1.0 에서 개선이 많이 됐기에, Client 모듈 적용도 괜찮을 듯.
5. GOOGLE, FACEBOOK 로그인은 간편 설정 연동 가능. (CommonOAuth2Provider)
6. 아직 과도기에 미구현 스펙(RFC)이 많기 때문에, Contribution 을 도전해볼 수 있음.
7. 어느것도 학습 비용이 높기 때문에, 직접 구현하는 것도 방법.