Le type d'octroi d'identifiants clients définit une procédure permettant d'émettre des jetons d'accès en échange d'identifiants d'application. Ces identifiants sont la clé client et le code secret qu'Apigee émet pour chaque application enregistrée dans une organisation. Pour en savoir plus, consultez la section Mettre en œuvre le type d'octroi de code d'autorisation.
Ajouter OAuth 2.0 à un nouveau proxy d'API
Vous pouvez ajouter la validation OAuth à une API lorsque vous créez un proxy d'API dans l'interface utilisateur d'Apigee.
Pour ajouter la validation OAuth à une API, procédez comme suit :
Sélectionnez Développer > Proxys API dans la barre de navigation de gauche.
Cliquez sur +Proxy.
Utilisez l'assistant de création de proxy pour créer un proxy inverse. Consultez la section Créer un proxy d'API simple.
Sur la page Règles communes de l'assistant, sélectionnez la case d'option à côté de OAuth
v2.0.
Lorsque vous sélectionnez cette option, deux règles sont associées au nouveau proxy d'API, l'une pour valider les jetons d'accès et l'autre pour supprimer le jeton d'accès après sa validation.
Notez que la case à cocher Publier le produit d'API devient sélectionnable et est automatiquement sélectionnée. Cochez cette option si vous souhaitez générer automatiquement un produit lorsque vous créez le proxy d'API. Le produit généré automatiquement sera créé avec une association au nouveau proxy d'API. Si vous avez un produit existant auquel vous souhaitez associer cette nouvelle API, assurez-vous de décocher cette case afin de ne pas créer de produit inutile. Pour plus d'informations sur les produits, consultez la section Qu'est-ce qu'un produit API ?
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 2025/09/05 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/05 (UTC)."],[[["\u003cp\u003eThis documentation applies to both Apigee and Apigee hybrid platforms.\u003c/p\u003e\n"],["\u003cp\u003eApigee uses app credentials, consisting of a consumer key and secret pair, to issue access tokens via the client credentials grant type.\u003c/p\u003e\n"],["\u003cp\u003eOAuth 2.0 verification can be added to a new API proxy during its creation in the Apigee UI.\u003c/p\u003e\n"],["\u003cp\u003eSelecting the OAuth 2.0 option during API proxy creation automatically attaches policies to verify and strip access tokens.\u003c/p\u003e\n"],["\u003cp\u003eYou can optionally auto-generate an API product linked to the new API proxy, or clear this option to associate it with an existing product.\u003c/p\u003e\n"]]],[],null,["# OAuth 2.0: Configuring a new API proxy\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\nThe client credentials grant type defines a procedure for issuing access tokens in exchange\nfor **app credentials** . These app credentials are the consumer key and secret\npair that Apigee issues for each app that is registered in an organization. For more\ndetails, see [Implementing\nthe authorization code grant type](/apigee/docs/api-platform/security/oauth/oauth-v2-policy-authorization-code-grant-type).\n\nAdd OAuth 2.0 to a new API proxy\n--------------------------------\n\nYou can add OAuth verification to an API when you create a new API proxy in the Apigee UI.\n\nTo add OAuth verification to an API:\n\n1. Sign in to [Apigee UI](https://apigee.google.com).\n2. Select **Develop \\\u003e API Proxies** in the left navigation bar.\n3. Click **+ Proxy**\n4. Use the Create Proxy wizard to create a Reverse proxy. See [Build a simple API\n proxy](/apigee/docs/api-platform/fundamentals/build-simple-api-proxy).\n5. On the **Common policies** page of the wizard, select the radio button next to **OAuth\n v2.0**.\n\nWhen you select this option, two policies will be attached to the\nnewly created API proxy, one to verify access tokens and another to strip the access token after\nit has been verified.\n\nNote that the **Publish API\nProduct** checkbox becomes selectable and is automatically selected. Check this if\nyou want to automatically generate a product when you build the new API proxy. The autogenerated\nproduct will be created with an association to the new API proxy. If you have an existing product\nwith which you want to associate this new API, be sure to clear this checkbox so that you don't\ncreate an unnecessary product. For information about products, see [What is an API product?](/apigee/docs/api-platform/publish/what-api-product)"]]