iosgoogle-oauthuri-scheme

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.

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


Solution

  • 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