Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Authentifizierungsmethode auswählen
API Gateway unterstützt mehrere Authentifizierungsmethoden, die sich für unterschiedliche Anwendungen und Anwendungsfälle eignen. API Gateway verwendet die Authentifizierungsmethode, die Sie in der Dienstkonfiguration angegeben haben, um eingehende Anfragen zu prüfen, bevor sie an das API-Back-End weitergeleitet werden. Auf dieser Seite finden Sie eine Übersicht über die einzelnen unterstützten Authentifizierungsmethoden in API Gateway.
API-Schlüssel
Ein API-Schlüssel ist ein einfacher String, der einGoogle Cloud -Projekt zu Kontingent-, Abrechnungs- und Monitoringzwecken identifiziert. Entwickler generieren einen API-Schlüssel in einem Projekt in der Google Cloud Console und betten diesen in jeden Aufruf an die API als Abfrageparameter oder in einen Anfrageheader ein.
Anwendungsfall
Wenn Sie API Gateway-Funktionen wie Kontingente verwenden möchten, können Sie einen API-Schlüssel übergeben, damit API Gateway das Google Cloud Projekt identifizieren kann, mit dem die Clientanwendung verknüpft ist. Weitere Informationen finden Sie unter API-Schlüssel verwenden.
Dienstkonten
Zur Identifizierung eines Dienstes, der Anfragen an Ihre API sendet, wird ein Dienstkonto verwendet. Mit dem privaten Schlüssel des Dienstkontos signiert der aufrufende Dienst ein sicheres JSON Web Token (JWT) und sendet es in der Anfrage an die API.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-03 (UTC)."],[[["\u003cp\u003eAPI Gateway offers multiple authentication methods for different applications and use cases, validating requests before forwarding them to the API backend.\u003c/p\u003e\n"],["\u003cp\u003eAPI keys, which are strings identifying a Google Cloud project, are used for quota, billing, and monitoring, and are embedded in API calls.\u003c/p\u003e\n"],["\u003cp\u003eService accounts utilize JSON Web Tokens (JWTs) for secure authentication of services making requests to your API, which are well-suited for microservices.\u003c/p\u003e\n"]]],[],null,["# Choosing an Authentication Method\n=================================\n\nAPI Gateway supports multiple authentication methods that are suited to different applications and use cases. API Gateway uses the authentication method that you specify in your service configuration to validate incoming requests before passing them to your API backend. This page provides an overview for each supported authentication method in API Gateway.\n\nAPI keys\n--------\n\nAn API key is a simple string that identifies a\nGoogle Cloud project for quota, billing, and monitoring purposes. A\ndeveloper generates an API key in a project in the Google Cloud console and\nembeds that key in every call to your API as a query parameter or in a request header.\n\n### Use case\n\nTo use API Gateway features such as\n[quotas](/api-gateway/docs/quotas-overview), you can pass in an API\nkey so that API Gateway can identify the Google Cloud project\nthat the client application is associated with. For more information, see\n[Using API Keys](/api-gateway/docs/authenticate-api-keys).\n\nService accounts\n----------------\n\nTo identify a service that sends requests to your API, you use a\n[service account](/docs/authentication#service_accounts). The calling service\nuses the service account's private key to sign a secure\n[JSON Web Token (JWT)](https://jwt.io/)\nand sends the signed JWT in the request to your API.\n\n### Use case\n\nJWTs and service accounts are well suited for microservices. For more\ninformation, see\n[Authentication between services](/api-gateway/docs/authenticate-service-account)."]]