문제

모바일에서 구글을 열려고 할때 오류 발생

Access blocked: Authorization Error

You can’t sign in from this screen because this app doesn’t comply with Google’s secure browsers policy. If this app has a website, you can open a web browser and try signing in from there.

You can let the app developer know that this app doesn’t comply with Google’s secure browsers policy. Learn more about this error

If you are a developer of EmoTrak, see error details.

Error 403: disallowed_useragent

원인

내부 구현 조건인 webview 로 된 인앱 브라우져로 googleOauth 2.0 링크를 여는 경우 발생하는 문제

구글은 2016년 10월 20일 부터 webview로 구글 인증을 하지 못하도록 막았다. (Google 정책 변경으로 Chrome을 기본 브라우저 설정)

즉, 구글 인증 링크를 웹으로 열기 위해서는 앱에서 브라우저를 호출해야 하는데 이때 호출하는 인앱 브라우저의 구현체가 webview 인 경우 오류가 발생한다 .

https://developers-kr.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html

해결

  1. SDK를 사용하여 직접 구현
  2. 해당 userAgent를 변경하여 우회하는 방법이 있지만, 구글에서 권하지 않는 방법
  3. 구글 인증 링크를 웹뷰로 구현된 인앱 브라우저가 아닌 Chrome탭으로 변경