Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 201
Poke Avatar asked Feb 16 '17 09:02

Poke


1 Answers

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

like image 162
Nick Avatar answered Sep 18 '22 12:09

Nick