feat: 인앱 브라우저 구글 로그인 외부 브라우저 우회#242
Merged
Merged
Conversation
|
Caution Review failedPull request was closed or merged during review Walkthrough
Changes인앱 브라우저 OAuth2 외부 브라우저 우회
Sequence Diagram(s)sequenceDiagram
participant Client as 인앱 브라우저 클라이언트
participant InAppFilter as InAppBrowserRedirectFilter
participant Detector as InAppBrowserDetector
participant OAuthFilter as OAuth2AuthorizationRequestRedirectFilter
Client->>InAppFilter: GET /oauth2/authorization/google
InAppFilter->>Detector: isInAppBrowser(User-Agent)
Detector-->>InAppFilter: true
InAppFilter->>InAppFilter: buildExternalUrl(request)
alt Android
InAppFilter-->>Client: intent:// Chrome 강제 실행 HTML
else iOS
InAppFilter-->>Client: Safari 안내 + 주소 복사 HTML
end
Note over Client,OAuthFilter: 인앱 브라우저가 아닌 경우
Client->>InAppFilter: GET /oauth2/authorization/google
InAppFilter->>Detector: isInAppBrowser(User-Agent)
Detector-->>InAppFilter: false
InAppFilter->>OAuthFilter: doFilter(request, response)
OAuthFilter-->>Client: Google OAuth2 리다이렉트
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
빌드 성공 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 관련 이슈
🔍 작업 내용
스레드 등 인앱 브라우저(WebView)에서 구글 로그인 시 403(
disallowed_useragent)으로 막히는 문제를 해결했습니다.구글이 보안 정책상 WebView에서의 OAuth 로그인을 차단하기 때문에, 인앱 브라우저로 로그인 진입 시 외부 브라우저로 우회시킵니다.
📝 변경 사항
InAppBrowserDetector추가: User-Agent로 인앱 브라우저 / Android / iOS 판별; wv)) + Threads(Barcelona)/Instagram/Facebook/카카오톡/라인/네이버/다음/밴드 등 앱 시그니처 감지InAppBrowserRedirectFilter추가:/oauth2/authorization/**진입 요청을 가로채 외부 브라우저로 우회intent://스킴으로 크롬 강제 실행 (크롬 미설치 시fallback_url로 폴백)SecurityConfig:OAuth2AuthorizationRequestRedirectFilter앞에 필터 등록 (구글 리다이렉트 전에 동작)InAppBrowserDetectorTest추가: UA 판별 로직 검증💬 리뷰어에게
열립니다.
@Component빈이 아니라SecurityConfig에서 직접new로 생성했습니다.OncePerRequestFilter를 빈으로 등록하면 전체 서블릿 체인에도중복 등록되기 때문에 시큐리티 체인에만 적용되도록 했습니다.
InAppBrowserDetector의IN_APP_PATTERN한 곳만 수정하면 됩니다.Summary by CodeRabbit
릴리스 노트
New Features
Tests