문제 증상

액세스 토큰을 확보하려고 시도하면 다음과 같은 오류 메시지가 표시됩니다.

{"error":"invalid_grant",
"error_description":"The provided access grant is invalid,
expired, or revoked (e.g. invalid assertion, expired authorization
token, bad end-user password credentials, or mismatching authorization
code and redirection URI).

해결 단계

리디렉션 URL에 사용된 매개변수가 아래에 표시된 대로 redirect_uri이며, 기울임꼴로 표시된 섹션을 데이터로 바꿉니다.

curl https://yoursubdomain.zendesk.com/oauth/tokens \
  -H "Content-Type: application/json" \
  -d '{"grant_type": "authorization_code", "code": "your_code",
    "client_id": "your_client_id", "client_secret": "your_client_secret", 
    "redirect_uri": "your_redirect_url", "scope": "read" }' \
  -X POST
중요: 매개변수는 다음과 같아야 합니다. redirect_uri

자세한 내용은 애플리케이션에 OAuth 인증 사용하기 문서를 참조하세요.

Zendesk 제공