갱신 토큰은 원본 액세스 토큰이 만료되거나 취소된 후 새 액세스 토큰을 얻는 데 사용됩니다. 갱신 토큰은 일부 부여 유형에서 액세스 토큰과 함께 선택적으로 발급됩니다.
안티패턴
갱신 토큰은 Apigee 또는 외부 리소스를 통해 발급할 수 있습니다.
하지만 RefreshAccessToken 작업을 통해 갱신 토큰을 사용하지 않는 경우 이는 안티패턴입니다.
영향
갱신 토큰을 유지하면 인증 시스템의 성능과 신뢰성 모두에 불필요하게 부정적인 영향을 미칩니다.
권장사항
갱신 토큰이 필요하지 않은 경우
갱신 토큰이 필요하지 않은 경우 개발자는 새 액세스 토큰을 생성할 때 '클라이언트 사용자 인증 정보' 또는 '암시적' 권한 부여 유형을 사용해야 합니다.
이러한 권한 부여 유형은 갱신 토큰을 발급하지 않으므로 갱신 토큰 기능이 필요하지 않은 경우에 적합합니다.
프록시가 갱신 토큰으로 읽기 작업만 실행하는 경우
Apigee는 갱신 토큰 속성을 검색하는 데 사용할 수 있는
GetOAuthV2Info를 제공합니다. 개발자는 이 정책을 사용하여 갱신 토큰을 검증해서는 안 됩니다.
갱신 토큰이 새 액세스 토큰으로 교환되지 않는 것은 안티패턴입니다. Apigee는
외부 액세스 및 갱신 토큰을 사용할 수 있습니다. 갱신 토큰 흐름이 Apigee 외부에서 발생하는 경우 가져온 갱신 토큰이 더 이상 유효하지 않도록 RefreshAccessToken 작업을 사용하여 Apigee 시스템에서 적절하게 삭제하는 것이 좋습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 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)"]]