Obtenir des identifiants d'autorisation
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Votre application doit disposer d'identifiants d'autorisation pour pouvoir utiliser l'API YouTube Live Streaming.
Ce document décrit les différents types d'identifiants d'autorisation compatibles avec la console Google APIs. Il explique également comment trouver ou créer des identifiants d'autorisation pour votre projet.
Créer votre projet et sélectionner des services d'API
- Accédez à la page Identifiants dans la console API.
-
Cette page vous permet de créer deux types d'identifiants différents.
Cependant, toutes les méthodes de l'API YouTube Live Streaming nécessitent une autorisation OAuth 2.0.
Suivez les instructions ci-dessous pour générer des identifiants OAuth 2.0.
-
OAuth 2.0 : chaque fois que votre application demande des données utilisateur privées, elle doit envoyer un jeton OAuth 2.0 en même temps que la requête. Votre application envoie d'abord un identifiant client, puis éventuellement un code secret du client pour obtenir un jeton. Vous pouvez générer des identifiants OAuth 2.0 pour des applications Web, des comptes de service ou des applications installées.
Pour en savoir plus, consultez la documentation OAuth 2.0.
-
Clés API:vous avez la possibilité d'inclure une clé API à une requête.
Cette clé identifie votre projet et vous donne accès à l'API, aux quotas et aux rapports.
Notez que toutes les méthodes de l'API YouTube Live Streaming nécessitent une autorisation OAuth 2.0.
Vous devez donc suivre les instructions ci-dessus pour générer des identifiants OAuth 2.0. Si vous le souhaitez, vous pouvez également envoyer une clé API, mais ce n'est pas nécessaire.
L'API propose plusieurs types de restrictions applicables aux clés API. Si la clé API dont vous avez besoin n'existe pas déjà, créez-en une dans la console en cliquant sur Créer des identifiants
> Clé API. Vous pouvez restreindre la clé avant de l'utiliser en production en cliquant sur Restreindre la clé et en sélectionnant l'une des restrictions.
Pour sécuriser vos clés API, suivez les Bonnes pratiques pour utiliser des clés API en toute sécurité.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2024/03/06 (UTC).
[null,null,["Dernière mise à jour le 2024/03/06 (UTC)."],[[["\u003cp\u003eAuthorization credentials are required for applications using the YouTube Live Streaming API.\u003c/p\u003e\n"],["\u003cp\u003eAll methods for the YouTube Live Streaming API necessitate OAuth 2.0 authorization, which requires the application to send a client ID and potentially a client secret to obtain a token.\u003c/p\u003e\n"],["\u003cp\u003eOAuth 2.0 credentials can be generated for web applications, service accounts, or installed applications through the Google API Console's Credentials page.\u003c/p\u003e\n"],["\u003cp\u003eWhile API keys are an option to identify a project, they are not necessary for the YouTube Live Streaming API, as it solely requires OAuth 2.0.\u003c/p\u003e\n"],["\u003cp\u003eAPI keys can be created and restricted within the API Console, following best practices for security.\u003c/p\u003e\n"]]],["To use the YouTube Live Streaming API, obtain authorization credentials via the Google API Console. All API methods require OAuth 2.0 authorization, which necessitates generating OAuth 2.0 credentials for web applications, service accounts, or installed applications by sending a client ID and potentially a client secret to obtain a token. While optional, you can also generate and send an API key, which identifies your project and can be created and restricted via the console.\n"],null,["Your application must have authorization credentials to be able to use the YouTube Live Streaming API.\n\nThis document describes the different types of authorization credentials that the [Google API Console](https://console.cloud.google.com/) supports. It also explains how to find or create authorization credentials for your project.\n\nCreate your project and select API services\n\n1. Open the [Credentials page](https://console.cloud.google.com/apis/credentials) in the API Console.\n2. The page allows you to create two different types of credentials. However, all of the methods for the YouTube Live Streaming API require OAuth 2.0 authorization. Follow the instructions below to generate OAuth 2.0 credentials.\n - **OAuth 2.0:** Whenever your application requests private user\n data, it must send an OAuth 2.0 token along with the request. Your\n application first sends a client ID and, possibly, a client secret to\n obtain a token. You can generate OAuth 2.0 credentials for web\n applications, service accounts, or installed applications.\n\n For more information, see the [OAuth 2.0 documentation](https://developers.google.com/identity/protocols/OAuth2).\n - **API keys:**\n\n You have the option of including an API key with a request.\n\n The key identifies your project and provides API access, quota, and\n reports.\n\n\n Note that all of the methods for the YouTube Live Streaming API require\n OAuth 2.0 authorization.\n\n\n For that reason, you need to follow the instructions above for\n generating OAuth 2.0 credentials. If you want, you can also send an\n API key, but that's not necessary.\n\n The API supports several types of restrictions on API keys. If the API key that you\n need doesn't already exist, then create an API key in the Console by\n clicking **[Create credentials](https://console.cloud.google.com/apis/credentials) \\\u003e API key** . You can restrict the key before using it\n in production by clicking **Restrict key** and selecting one of the\n **Restrictions**.\n\nTo keep your API keys secure, follow the [best practices for\nsecurely using API keys](//cloud.google.com/docs/authentication/api-keys)."]]