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

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

问题描述

我已经创建了自定义搜索引擎,并且需要以编程方式更新促销信息.这是在后端系统中完成的,因此,在身份验证过程中不能进行用户交互.

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已弃用此功能,它还涉及验证码,因此这不是一个选择.他们还指出,所有身份验证都应立即通过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.

我已经实现了OAuth2,而无需用户与Google Analytics(分析)API进行交互.

我的问题是: 我找不到要与OAuth2一起使用的Custom Search API的范围值.有什么想法吗?

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

推荐答案

我相信您可以使用API​​密钥功能(不是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 = zh_CN

是否有某些原因导致API密钥不起作用,并且您需要OAuth2?

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

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

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