Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- ExifInterface
- kdoc-generator
- shotcut
- notification bar
- App Startup
- room
- prettyJson
- Blinking
- onReceivedSslError
- navigation component
- Git
- 이미지 gps
- Plugins
- ChromeCustomTab
- Android
- skipcollapsed
- ActivityResultContracts
- webview
- datastore
- LOG
- itemAnimator
- 403 Error
- notification setting
- BottomSheetDialog
- application
- jsontokotlinclass
- circlecrop
- onResume
- requestPermission
- notification
Archives
- Today
- Total
Debbi Story
[Android] WebView 구글 로그인 403 Error 본문
728x90
안녕하세요, WebView에서 구글 로그인 페이지를 열때 403 Error가 발생하게 됩니다.
이유는 2016년 10월 20일 부터 웹뷰에서 Google OAuth 에 대한 요청을 허용하지 않는다고 합니다.
https://developers-kr.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html
더 나은 사용성과 보안을 위해 - 웹뷰에서의 OAuth 사용 제한
ID 팀은, 사용자가 자신의 구글 계정을 이용해, 다양한 애플리케이션에 쉽고 안전하게 로그인하고, 그리고 달력 또는 연락처 등의 정보를 다른 앱과 공유할 수 있도록 노력하고 있습니다. 이러한
developers-kr.googleblog.com
해결 방법으로 Chrome Custom Tab으로 열거나
WebView의 userAgent를 수정해 우회하는 방법이 있습니다.
fun getReplaceUserAgent(defaultAgent: String): String {
var userAgent = Regex(" Build/.+; wv").replace(defaultAgent,"")
userAgent = Regex("Version/.+? ").replace(userAgent,"")
return userAgent
}
제가 사용한 방법은 userAgent를 수정하는 방법으로 해결하였습니다!