Choisir une méthode d'authentification des charges de travail
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Ce document explique comment authentifier les applications ou les charges de travail qui s'exécutent dans un environnement de production sur Compute Engine, ou qui sont testées en local pour un déploiement ultérieur dans l'environnement de production. Vous pouvez procéder comme suit :
Authentifier vos charges de travail pour utiliser les API Google
Authentifier vos charges de travail auprès d'autres charges de travail via mTLS
Authentifier vos charges de travail pour utiliser les API Google
Le tableau suivant vous permet de déterminer la méthode d'authentification à utiliser pour vos charges de travail.
Tâche
Méthode
Authentifier des applications ou des charges de travail en production
Autoriser des applications et des charges de travail qui ont besoin d'accéder aux ressources de l'utilisateur final
Si vous créez des outils de développement ou d'administration dans lesquels les utilisateurs vous accordent l'accès à leurs Google Cloud ressources, vous devez permettre à vos applications d'accéder aux ressources utilisateur à l'aide d'OAuth 2.0. Pour obtenir des instructions détaillées, consultez la page
Utiliser OAuth 2.0 pour les applications de serveur Web.
Dans votre requête, spécifiez un niveau d'accès qui limite votre accès aux seules méthodes et informations utilisateur requises par votre application.
Pour obtenir la liste complète des services et des champs d'application requis pour l'ensemble de Google Cloud, consultez la page
Champs d'application OAuth 2.0 pour les API Google.
Authentifier vos charges de travail auprès d'autres charges de travail via mTLS
Vous pouvez authentifier des applications ou des charges de travail à l'aide des identités de charge de travail gérées. Cette méthode d'authentification utilise un compte de service, des pools d'autorités de certification et des identités de charge de travail gérées.
Les identités de charge de travail gérées vous permettent d'associer des identités fortement certifiées à vos charges de travail Compute Engine. Google Cloud provisionne des identifiants X.509 émis par le Certificate Authority Service et pouvant être utilisés pour authentifier de manière fiable votre charge de travail avec d'autres charges de travail via l'authentification TLS mutuel (mTLS).
Votre charge de travail utilise l'identité de charge de travail gérée comme identité lorsqu'elle s'authentifie auprès d'autres charges de travail à l'aide du protocole TLS mutuel (mTLS) et utilise le compte de service comme identité pour accéder à d'autres services et ressourcesGoogle Cloud .
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/03 (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/03 (UTC)."],[[["\u003cp\u003eThis document outlines how to authenticate applications or workloads in production on Compute Engine or during local testing for future deployment.\u003c/p\u003e\n"],["\u003cp\u003eWorkloads running on Google Cloud VMs in production should use the attached service account for authentication to access Google APIs.\u003c/p\u003e\n"],["\u003cp\u003eWorkloads in development can utilize the Google Cloud SDK and Application Default Credentials for authentication, and for access to end-user resources, they can leverage OAuth 2.0.\u003c/p\u003e\n"],["\u003cp\u003eManaged workload identities are available for strongly attesting identities to Compute Engine workloads, using X.509 credentials for mutual TLS (mTLS) authentication between workloads.\u003c/p\u003e\n"],["\u003cp\u003eManaged workload identities can authenticate to other workloads using mTLS, while the service account provides authentication to other Google Cloud services.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\nThis document describes how you authenticate applications or\nworkloads that are either running in a production environment on\nCompute Engine, or being tested locally for future deployment to the\nproduction environment. You can do the following:\n\n- Authenticate your workloads to use Google APIs\n- Authenticate your workloads to other workloads over mTLS\n\nAuthenticate your workloads to use Google APIs\n\nUse the following table to determine which authentication method to use\nfor your workloads.\n\n| **Task** | **Method** |\n|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Authenticate apps or workloads that are in production | Use the service account that is attached to the VM. \u003cbr /\u003e This is the most common method for authenticating apps and workloads that are running on virtual machine (VM) instances on Google Cloud. For detailed instructions, see [Authenticate workloads to Google Cloud APIs using service accounts](/compute/docs/access/authenticate-workloads). |\n| Authenticate apps or workloads that are in development | Use Google Cloud SDK and Application Default Credentials. For more information, see [Set up ADC for a local development environment](/docs/authentication/set-up-adc-local-dev-environment). |\n| Authorizing apps and workloads that need access to end-user resources | If you are building development or administration tools where users grant you access to their Google Cloud resources, get your application access to user resources by using OAuth 2.0. For detailed instructions, see [Using OAuth 2.0 for Web Server Applications](https://developers.google.com/identity/protocols/oauth2/web-server). \u003cbr /\u003e In your request, specify an access scope that limits your access to only the methods and user information that your application requires. For a full list of services and required scopes across Google Cloud, see [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes). |\n\nAuthenticate your workloads to other workloads over mTLS\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the\n| General Service Terms section of the\n| [Service Specific Terms](/terms/service-terms#1).\n| Pre-GA features are available \"as is\" and might have limited support. For more\n| information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n|\n| For information about access to this release, see the\n| [access request page](https://forms.gle/KC1Lq77gMn3kTtWDA).\n\nYou can authenticate applications or workloads using\n[managed workload identities](/iam/docs/managed-workload-identity). This\nauthentication method uses a service account, certificate authority (CA) pools,\nand managed workload identities.\n\nManaged workload identities let you bind strongly attested identities to\nyour Compute Engine workloads. Google Cloud provisions X.509 credentials\nissued from the [Certificate Authority Service](/certificate-authority-service) that can\nbe used to reliably authenticate your workload with other workloads over\n[mutual TLS (mTLS)](/chrome-enterprise-premium/docs/understand-mtls)\nauthentication.\n\nYour workload uses the managed workload identity as its\nidentity when it authenticates to other workloads using mutual TLS (mTLS),\nand uses the service account as its identity when it accesses other\nGoogle Cloud services and resources.\n\nFor more information, see\n[Authenticate workloads to other workloads over mTLS](/compute/docs/access/authenticate-workloads-over-mtls).\n\nWhat's next\n\n- Learn more about the following concepts:\n - [Authenticate to Compute Engine](/compute/docs/authentication)\n - [Authentication methods at Google](/docs/authentication)\n - [Managed workload identities](/iam/docs/managed-workload-identity)"]]