클라이언트 애플리케이션이 API로 보내는 요청에 JSON 웹 토큰(JWT)을 포함하는 경우 Extensible Service Proxy(ESP)는 API 백엔드에 요청을 보내기 전에 JWT를 검증합니다. 이 페이지에서는 JWT 검증이 실패하고 ESP가 클라이언트에 대한 응답에 오류를 반환하는 경우의 문제해결 정보를 제공합니다. JWT에 대한 자세한 내용은 RFC 7519를 참조하세요.
오류: 401: Jwt issuer is not configured
이는 Cloud Run에서 ESPv2를 배포할 때 발생할 수 있으며 gcloud run deploy 명령어에서 --allow-unauthenticated 플래그가 사용되지 않습니다.
이 플래그를 사용하지 않으면 ESPv2가 아닌 Cloud Run <a=" docs="" managing-access"="" run="" securing=""> 액세스 제어 IAM 서버에서 JWT 토큰을 가로채고 확인합니다. IAM은 ESPv2와 다른 발급자를 사용할 수 있습니다.
</a=">
오류: BAD_FORMAT
다음을 확인해 보세요.
JWT에 유효한 JSON이 들어 있는지 확인합니다.
JWT 헤더에 "alg" 필드가 있으며 "RS256", "HS256", "RS384", "HS384", "RS512" 또는 "HS512" 중 하나로 설정되어 있는지 확인합니다.
JWT 토큰의 "aud"(대상) 클레임이 Endpoints 서비스 이름과 일치하는 경우 Cloud Endpoints Frameworks는 대상을 검증하고 ApiIssuerAudience 주석의 audiences 요소에 설정된 값을 무시합니다. 예를 들어 서비스 이름이 "myservice.appspot.com"인 경우 "aud"가 "myservice.appspot.com" 또는 "https://myservice.appspot.com"으로 설정된 JWT는 유효한 대상입니다.
"aud" 클레임이 Endpoints 서비스 이름과 같지 않은 경우:
JWT의 "aud" 클레임이 ApiIssuerAudience 주석의 audiences 요소 값 중 하나와 일치하는지 확인합니다.
[[["이해하기 쉬움","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-08-18(UTC)"],[[["\u003cp\u003eThe Extensible Service Proxy (ESP) validates JSON Web Tokens (JWTs) before requests reach the API backend, and this document provides guidance for troubleshooting JWT validation failures.\u003c/p\u003e\n"],["\u003cp\u003eJWT validation errors such as \u003ccode\u003e401: Jwt issuer is not configured\u003c/code\u003e, \u003ccode\u003eBAD_FORMAT\u003c/code\u003e, \u003ccode\u003eTIME_CONSTRAINT_FAILURE\u003c/code\u003e, \u003ccode\u003eUNKNOWN\u003c/code\u003e, \u003ccode\u003eKEY_RETRIEVAL_ERROR\u003c/code\u003e, \u003ccode\u003eIssuer not allowed\u003c/code\u003e, and \u003ccode\u003eAudience not allowed\u003c/code\u003e can occur due to various configuration and format issues.\u003c/p\u003e\n"],["\u003cp\u003eEnsure that JWTs are correctly formatted with valid JSON, and have required fields such as \u003ccode\u003e"alg"\u003c/code\u003e, \u003ccode\u003e"iat"\u003c/code\u003e, \u003ccode\u003e"exp"\u003c/code\u003e, \u003ccode\u003e"nbf"\u003c/code\u003e, \u003ccode\u003e"sub"\u003c/code\u003e, \u003ccode\u003e"iss"\u003c/code\u003e, \u003ccode\u003e"jti"\u003c/code\u003e, and \u003ccode\u003e"aud"\u003c/code\u003e with the correct data types and values.\u003c/p\u003e\n"],["\u003cp\u003eVerify that time-related claims like \u003ccode\u003e"exp"\u003c/code\u003e and \u003ccode\u003e"nbf"\u003c/code\u003e are appropriately set for the current time, and use tools like jwt.io to decode and inspect the JWT's contents.\u003c/p\u003e\n"],["\u003cp\u003eProper configuration of the public key URI (\u003ccode\u003ejwksUri\u003c/code\u003e) and issuer (\u003ccode\u003eiss\u003c/code\u003e) are crucial to avoid errors such as \u003ccode\u003eKEY_RETRIEVAL_ERROR\u003c/code\u003e and \u003ccode\u003eIssuer not allowed\u003c/code\u003e, and the \u003ccode\u003eaud\u003c/code\u003e (audience) must match the service name or be within the allowed \u003ccode\u003eaudiences\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]