错误:invalid_client 没有注册的来源 [英] Error: invalid_client no registered origin
问题描述
我已按照这些说明在我的网络服务器上安装了 Google Drive Realtime API 示例文件,包括在 Cloud Console 中生成 client_id 并将其插入到 index.html
文件中.
I have installed the Google Drive Realtime API sample files on my web server, following these instructions, including generating a client_id in the Cloud Console and inserting it into the index.html
file.
当我访问该页面并单击按钮以授权应用程序时,它会弹出一个新窗口并显示:
When I visit that page and click the button to authorize the app, it pops up with a new window and shows:
错误:invalid_client
无注册产地
请求详情是:
openid_connect_request=true
cookie_policy_enforce=false
scope=https://www.googleapis.com/auth/drive.install https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/plus.me
response_type=token
access_type=online
redirect_uri=postmessage
proxy=oauth2relay865404532
origin=http://mywebsite.com
state=264939258|0.165356673
display=page
client_id=1077585001321.apps.googleusercontent.com
authuser=0
我在 Cloud Console 中看不到我应该使用的任何其他 client_id.有谁知道如何克服这个错误?感谢您的帮助.
I can't see any other client_id that I should be using in the Cloud Console. Does anybody know how to overcome this error? Thanks for your help.
推荐答案
在新的 Google API 控制台中,配置您的 OAuth2.0 授权来源
In the new Google API Console, configure your OAuth2.0 authorized origins from
Your Project > APIs & auth > Credentials
您可能需要专门为 Web 应用程序添加一个新的客户端 ID(我这样做是因为默认是用于 AppEngine)
You might need to add a new Client ID specifically for a web application (I did because the default was for AppEngine)
Create Client ID > Web Application > Authorized Javascript origins
如果您在本地开发服务器上运行,只需添加确切的 URL,例如:
If you are running on a local dev server, just add the exact URL such as :
http://127.0.0.1:9000
这篇关于错误:invalid_client 没有注册的来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!