我的应用程序通过在我的请求中的hd参数中指定abc.com来限制Oauth2登录到特定域,如abc.com.使用Google OAuth2.0将登录电子邮件限制为特定域名,但由于过去几天它允许任何拥有Google帐户的人登录.我确信我没有更改代码甚至验证结果uri已在其中指定了我的域名高级参数跟随此链接说明https://developers.google.com/identity/protocols/OpenIDConnect#hd-param .so cany任何人告诉我我做错了什么?这是我的代码
`redirect( uri : "https://accounts.google.com/o/oauth2/auth?" +
"redirect_uri=${redirectUri}&" +
"response_type=code&" +
"client_id="${my_client_id}"& +
"scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email" +
"+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&" +
"approval_prompt=auto&" +
"hd=apposit.com")`
Run Code Online (Sandbox Code Playgroud) 我在使用Thinktecture身份服务器v3集成外部提供商即谷歌时遇到问题.我收到以下错误:"客户端应用程序未知或未经授权." 任何人都对这个错误有所了解.
我正在寻找与支持Google OAuth 2.0的API一起使用的所有可能范围值的列表,例如:
https://www.googleapis.com/auth/urlshortener
https://www.googleapis.com/auth/tasks
Run Code Online (Sandbox Code Playgroud)
我迷失在Google API文档中,无法找到包含此类信息的页面.我在哪里可以找到它?
谢谢.
我无法理解 Google 产品/服务中使用的 \xe2\x80\x9cAPI discovery\xe2\x80\x9d 的概念。这里\xe2\x80\x99是一些使用上述发现服务访问Google Cloud Vision的Python代码:
\n\nfrom googleapiclient.discovery import build\nfrom oauth2client.client import GoogleCredentials\n\xe2\x80\xa6 \nAPI_DISCOVERY_FILE = \'https://vision.googleapis.com/$discovery/rest?version=v1\'\nhlh = httplib2.Http()\ncredentials = GoogleCredentials.get_application_default().create_scoped(\n [\'https://www.googleapis.com/auth/cloud-platform\'])\ncredentials.authorize(hlh)\nservice = build(serviceName=\'vision\', version=\'v1\', http=hlh, discoveryServiceUrl=API_DISCOVERY_FILE)\nservice_request = service.images().annotate(body={ <more JSON code here> })\nRun Code Online (Sandbox Code Playgroud)\n\nHere\xe2\x80\x99s 的另一段 Python 代码也可以访问 Google Cloud Vision,但不使用 API 发现并且工作得很好:
\n\nimport requests\n\xe2\x80\xa6\nENDPOINT_URL = \'https://vision.googleapis.com/v1/images:annotate\'\nresponse = requests.post(ENDPOINT_URL,\n data=make_image_data(image_filenames),\n params={\'key\': api_key},\n headers={\'Content-Type\': \'application/json\'})\nRun Code Online (Sandbox Code Playgroud)\n\n我能\xe2\x80\x99t思考的是这个问题:你需要知道你将要调用的API的详细信息,以便你可以定制调用;这是显而易见的。那么,在您准备好调用该 API 的代码之后,API 发现将如何在调用时为您提供帮助?
\n\nPS:在发布此问题之前,我确实查看了以下资源:\n
\n https://developers.google.com/discovery/v1/getting_started \n
\n https://developers.google.com/discovery/ v1/using \n
\n我确实看到了这个已回答的问题,但希望有更多的见解。 …