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

安稳与你 提交于 2019-11-28 09:39:07

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

I Just found this problem too.
Please check google developer console and look at the credentials keys
Your Client ID in google-info plist must come from iOS application, not the web.
And use that Client ID to be revereseClientID and copy it in to URI type

you must cross check clientId at your 'Google Dashboard' clientId and clientId at "GoogleProject.Plsit".if both are different, copy ClientID from 'Google Dashboard' and paste it on "GoogleService-Info.Plsit".and also amend your reverseClientId in "GoogleService-Info.Plsit" according to newly pasted ClientID(you check the pattern how reverseClientId created from client Id in "GoogleService-Info.Plsit"). And then paste thid reverseClientId in 'URL type' in your project setting.

In case of mine clientId on "GoogleService-Info.Plsit" and my 'Google Dashboard' were different. chech your google dashboard here : https://console.developers.google.com/apis/credentials?project=firebase

I just experienced this issue following the Google Signin for iOS Guide. The plist generated file is not the good one. You need to take a look at the clientID and reversedClientID and be sure that they are the ones for the iOS app on your Google developer portal.

I have solved the problems by create project in Fire Base Because REVERSED_CLIENT_ID generate from developers.google.com Incorrect. Try create your project in FireBase https://console.firebase.google.com

I faced this error after previously creating a GoogleService-Info.plist file using the site Google Sign In directs you to. I later started using Firebase, which seems to create a separate .plist file. After attempting to include Firebase's new .plist file, my Google Sign In button started yielding the invalid_request error with the Custom scheme URIs are not allowed for WEB client type message.

In order to fix the problem I tried many things, but in the end deleting MY ENTIRE Firebase project on their web console (not just the individual app), recreating a new Firebase project from scratch, and re-downloading the new .plist file, solved the error.

It creates two client ID. one for web and one for iOS application. Web client will be in the google plist by default. So it gives the above error. Use iOS Client id from google console or create credential for iOS application.

For my experience, I had followed Google's SignIn iOS Swift guide and had downloaded a Web OAuth JSON file. They literally provide you the wrong Plist file for an iOS setup.

Just in case somebody else runs into this issue here are the steps I followed:

  1. Go to the Google Developers console.
  2. Go to the Credentials section.
  3. Notice there are two items in the "OAuth 2.0 client IDs" section. (If you previously attempted to configure an iOS Google SignIn project.
  4. Click on the name of the "iOS client for ".
  5. Click "Download PLIST File".
  6. Delete the Google web Plist file from your project.
  7. Drop in the new iOS based Plist file.
  8. Copy over the new REVERSED_CLIENT_ID into your URL Types of the Info page of your project. (This is detailed in Google's guide).
  9. Attempt to run your app again.

Note: I got the Google Sign In API to work with Swift v3 and XCode v8.

I was getting the same error. Then I figured out, that I did not provide my app Bundle Id to access the Google Sign In Service in my app. You do that from the page with the link:

https://developers.google.com/mobile/add?platform=ios&cntapi=signin&cnturl=https:%2F%2Fdevelopers.google.com%2Fidentity%2Fsign-in%2Fios%2Fsign-in%3Fconfigured%3Dtrue&cntlbl=Continue%20Adding%20Sign-In

1.Sign in with your Google Developer account.

2.Create you app name and copy the App bundle Id from your project from: Project and Target List> General> Bundle Identifier.

3.Choose your Country

4.Enable Google- Sign In.

Then perform the necessary steps to integrate Google Sign In in with your iOS App.

I was facing the same issue. I followed all the instructions to integrate my app several times, and played with the code to see if there was any hidden issue in the code. I downloaded and configured the sample app from google at github https://github.com/googlesamples/google-services and go the same issue, so it was not the code.

It seemed like there is something in my console configuration so I switched between different google console apps, and played changing the bundle IDs.

The only thing that managed to fix this issue was to use Firebase instead. I created an app in the firebase console, downloaded the new plist, and it worked.

Still not sure why this didn't work for me in the first place, this doesn't seem to be a common problem, but I hope this helps someone. cheers,

Kindly check console.developers.google.com/apis/credentials for your project and see whether there is already a client_id in OAuth 2.0 client IDs section , if so then copy that client id and replace it with you GoogleService-Info.plist file's CLIENT_ID and accordingly change REVERSED_CLIENT_ID (in reverse manner) now clean and build your app and test it will work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!