authentication - YouTube 直播 API 请求与 Api key

标签 authentication youtube-api google-oauth

我正在使用 YouTube 直播 API 服务,如下所述,

https://developers.google.com/youtube/v3/live/registering_an_application#create_project

我希望您使用 API key ,而不是 OAuth 2.0 进行通信。但是当我请求时

https://www.googleapis.com/youtube/v3/liveBroadcasts?part=id&broadcastStatus=all&key=[My_App_Key]

我总是以

结束
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}

知道为什么我被迫使用 OAuth 并且无法使用 API key 进行操作吗?

最佳答案

LiveBroadcasts: list在顶部声明

Authorization

This request requires authorization with at least one of the following scopes (read more about authentication and authorization).

您不能通过此方法使用公共(public) API key ,您必须使用 oauth2 进行身份验证。

关于authentication - YouTube 直播 API 请求与 Api key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32182825/

相关文章:

node.js - Passport 使用 NextJs 和 Express 对每个请求调用 deserializeUser

django - 有人认为 django 的用户模型与身份验证耦合得太紧了吗?

javascript - 使用 JS/PHP 验证登录表单

android - Youtube App-安全搜索API/锁定设置

javascript - 如何在 Node.js 中发现 Google OAuth2 中的 API

ajax - 使用基于表单的身份验证时适当的未授权响应

python-3.x - 检查视频是否有年龄限制

java - 如何在 Java 中转换 Youtube API V3 持续时间

apache - Apache 反向代理中的 Google OAuth 重定向 Uri

javascript - 如何允许用户在 Node JS Passport JS 失败后尝试使用不同的电子邮件?