Google 400 Error: invalid request Custom scheme URIs are not allowed for 'Web' client type

Poke picture Poke · Feb 16, 2017 · Viewed 18.8k times · Source

When I am signing into Gmail in my iOS App, I am getting the below error (screenshot) and the sign-in fields do not appear. We are loading the sign-in screen in a WKWebView.

  • We are using a custom URI redirect but why is google throwing this error now. What are the alternatives to a custom URI?
  • Swift 2.3 project
  • Using OAuthSwift v0.6.0 cocoapod
  • This started quite recently only in the past week or so I believe something changed with Google's APIs.

I have read that google is deprecating webviews for OAuth and will block requests on April 20, 2017. As seen here in a Google Developers Blog: https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html

Does this mean I already need to use or is there another viable solution? I thought I had more time before needing to update this.

enter image description here

Answer

Nick picture Nick · Feb 16, 2017

My guess is that your client is registered incorrectly in Google Cloud Console. A 'WEB' client is typically a server or Javascript application. An iOS app should be registered as an iOS client.

https://developers.google.com/identity/protocols/OAuth2InstalledApp#creatingcred