Google API Manager OAuth consent screen configuration Error

纵饮孤独 提交于 2019-12-19 08:14:23

问题


I've created an new project in the Google Developers Console and wanted to add OAuth 2.0 client ID Credentials for a Web Application, wich requires me to set a product name on the consent screen. Once I hit save after entering a product name on the OAuth constent screen configuration tab an error occurs and my changes are not applied:

The user request is invalid. Please check your URL and try again.

Server Response:

{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT"
  }
}

I guess the problem is name or mail related since all parameters except for poduct name and support mail address are optional. Tries all sort of strings as product name (without space, lowercase, long, short, random).

Since the error code is not mail related I'm tempted to believe that my issue isn't related to others I found.

Also tried to fill every optional parameter with valid URLs, but that did not help either.

Hope someone encountered a similar issue and can give me some advice. Thank you!


回答1:


So here's how I fixed this. Let's go on a picture adventure story to fix this little pesky Google-total-fudge-up.

I, too, created my account a long while ago as @googlemail.com but in the drop down only @gmail.com was showing:

I tried @Peer's answer and added myself to the project again with my full @googlemail.com email. I did this via this URL:

https://console.cloud.google.com/projectselector/permissions/projectpermissions

(I include the link because I found no way to navigate to this from the too-clean-for-actual-links Google Console)

However, even after accepting the invitation, only my @gmail email appeared in the drop down list on the consent configuration screen, the @googlemail.com was still regarded as "Waiting for response" and, best of all, it still didn't save:

So I did the following:

  • Opened up Fiddler
  • Hit the save button on the consent form to enjoy the error one last time (and also record it in Fiddler)
  • Locate the bad request in Fiddler (nice and red for us):
  • Enable editing on the bad request:
  • Select the Inspectors tab and edit the supportEmail field to change my email address to @googlemail.com:
  • Right click on the bad request now it has been edited and navigate to Replay -> Reissue Requests:

The new request worked a charm, and now when I reloaded my consent screen the settings had saved, but even better the drop down had the full @googlemail.com option:

So I selected my @googlemail.com address and the save button worked happily ever after:

(Although apparently I am still waiting for my own response...)




回答2:


I fixed the problem by switching the "@googlemail.com" address to "@gmail.com" via Gmail-settings ( https://mail.google.com/mail/#settings/accounts): Described here: https://support.google.com/mail/answer/159001?hl=en

After the change, the problem in the Google developers console diappeared.




回答3:


Or with curl and Chrome instead of Fiddler:

  • log your network traffic in Chrome (more tools - developer tools - network)
  • try again to save the OAuth consent screen (in the same tab)
  • search the POST request with the wrong supportEmail (xyz@gmail.com)
  • use the context menu on the POST request entry in the list and select "Copy as cURL"
  • paste in a terminal and change the supportEmail (to xyz@googlemail.com)

At least that worked for me.




回答4:


My E-Mail address was the problem. I've created the account a long time ago as xxx@googlemail.com account and could only select the xxx@gmail.com version. The support told me to add a second account to the project with another E-Mail address. Configured the consent screen and worked like a charm.




回答5:


My URI was the problem. But it still gave the same 400 error at the top. I had an underscore in it, but it was an internal DNS doing the routing so it didn't care. Google did.

E.g.

test_underscore.something.com #didn't work being added (it didn't exist) test-hyphen.something.com` did work (it didn't exist)



来源:https://stackoverflow.com/questions/33674606/google-api-manager-oauth-consent-screen-configuration-error

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