Google 自定义搜索 API 的 OAuth2 范围 [英] OAuth2 scope for Google Custom Search API

查看:23
本文介绍了Google 自定义搜索 API 的 OAuth2 范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 CSE,需要以编程方式更新促销活动.这是在后端系统中完成的,因此无法选择身份验证过程中的用户交互.

I have created a CSE and need to programatically update the promotions. This is done in a backend system and user interaction in the authentication process is therefore not an option.

可以通过 HTTP 使用自定义搜索 API 来更新促销活动.此过程需要身份验证令牌.

Updating the promotions can be done with their Custom Search API via HTTP. This process needs an authentication token.

他们的文档说自定义搜索仅支持ClientLogin"身份验证.这已被 Google 弃用,并且还涉及 CAPTCHA,因此这不是一个选项.他们还声明现在所有的身份验证都应该通过 OAuth2 完成.

Their documentation says that Custom Search only supports "ClientLogin" authentication. This has been deprecated by Google and it also involves CAPTCHAs so this is not an option. They also state that all authentication should be done through OAuth2 now.

我已经在没有用户与 Google Analytics API 交互的情况下实现了 OAuth2.

我的问题是:我找不到用于 OAuth2 的自定义搜索 API 的范围值.有什么想法吗?

My problem is: I cannot find the scope value for Custom Search API to use with OAuth2. Any ideas?

推荐答案

我相信您可以使用 API Key 函数(它不是 OAuth 2 密钥)来访问 CSE api.

I believe you can use the API Key function (which is not an OAuth 2 key) to access CSE apis.

这是文档.https://developers.google.com/custom-search/v1/using_rest?hl=en

API 密钥是否有任何原因不起作用而您需要 OAuth2?

Is there some reason the API key doesn't work and you need OAuth2?

这篇关于Google 自定义搜索 API 的 OAuth2 范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆