Anti-Pattern: Aktualisierungstokens ausstellen, ohne Aktualisierungsablauf aufzurufen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Sie lesen gerade die Dokumentation zu Apigee und Apigee Hybrid. Apigee Edge-Dokumentation aufrufen.
Mit Aktualisierungstokens werden neue Zugriffstoken abgerufen, nachdem das ursprüngliche Zugriffstoken abgelaufen oder widerrufen wurde. Aktualisierungstoken werden optional mit einigen Grant-Typen zusammen mit Zugriffstoken ausgegeben.
Anti-Pattern
Aktualisierungstokens können entweder von Apigee oder über externe Ressourcen ausgestellt werden.
Dies ist jedoch ein Antimuster, wenn das Aktualisierungstoken nie über den Vorgang „RefreshAccessToken“ verwendet wird.
Auswirkungen
Das Speichern von Aktualisierungstokens wirkt sich unnötig negativ auf die Leistung und Zuverlässigkeit des Authentifizierungssystems aus.
Best Practice
Wenn das Aktualisierungstoken nie benötigt wird
Wenn keine Aktualisierungstokens erforderlich sind, sollten Entwickler beim Generieren neuer Zugriffstokens die Granttypen „Clientanmeldedaten“ oder „implizit“ verwenden.
Bei diesen Grant-Typen werden keine Aktualisierungstokens ausgestellt. Das ist sinnvoll, wenn die Funktion für Aktualisierungstokens nicht erforderlich ist.
Wenn der Proxy nur Lesevorgänge mit Aktualisierungstokens ausführt
Apigee bietet
GetOAuthV2Info, mit dem Aktualisierungstoken-Attribute abgerufen werden können. Entwickler sollten diese Richtlinie nicht zum Validieren von Aktualisierungstokens verwenden.
Es ist ein Antimuster, wenn das Aktualisierungstoken nie gegen ein neues Zugriffstoken eingetauscht wird. Apigee kann mit
externen Zugriffs- und Aktualisierungstokens arbeiten. Wenn der Ablauf des Aktualisierungstokens außerhalb von Apigee erfolgt, wird dringend empfohlen, den Vorgang „RefreshAccessToken“ zu verwenden, damit alle importierten Aktualisierungstokens, die nicht mehr gültig sind, ordnungsgemäß aus dem Apigee-System entfernt werden.
[[["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-05 (UTC)."],[],[],null,["# Antipattern: Issuing refresh tokens without invoking refresh flow\n\n*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/antipatterns/issuing-refresh-tokens) documentation.*\n\n\nRefresh tokens are used to obtain new access tokens after the original access\ntoken has expired or been revoked. Refresh tokens are optionally issued along\nwith access tokens with some of the grant types.\n\nAntipattern\n-----------\n\n\nRefresh tokens can be issued either by Apigee or via external resources.\nHowever, this is an antipattern if the refresh token is never used via the\nRefreshAccessToken operation.\n\nImpact\n------\n\n\nPersisting refresh tokens unnecessarily negatively impacts both performance\nand reliability of the authentication system.\n\nBest practice\n-------------\n\n### If the refresh token is never needed\n\n\nIf refresh tokens are not needed, developers should use the 'client\ncredentials' or 'implicit' grant types when generating new access tokens.\nThese grant types do not issue refresh tokens, which is desirable if the\nrefresh token functionality is not required.\n\n### If the proxy performs only read operation with refresh tokens\n\n\nApigee offers\n[GetOAuthV2Info](https://cloud.google.com/apigee/docs/api-platform/reference/policies/get-oauth-v2-info-policy#refresh-token) which can be used to retrieve refresh token\nattributes. Developers should not use this policy to validate refresh tokens.\nIt is an antipattern that the refresh token is never used to exchange for a\nnew access token. Note that Apigee can work with\n[external access and refresh tokens](/apigee/docs/api-platform/security/oauth/use-third-party-oauth-system). If the refresh token flow happens\noutside of Apigee, it's highly recommended to use the RefreshAccessToken\noperation such that any imported refresh tokens no longer valid are properly\nremoved from the Apigee system.\n\nFurther reading\n---------------\n\n[Refreshing an access token](/apigee/docs/api-platform/security/oauth/access-tokens#refreshinganaccesstoken)"]]