Access Token grant_type 에러

김준민

2022.06.27읽음 1352

안녕하세요,

저번 주 부터 갑자기 access token이 발급되지 않습니다.

아래와 같이 url과 파라미터를 넣었고 파라미터를 인코딩해도 에러가 나옵니다.

params = {
   'code' : code,
   'grant_type' : 'authorization_code',
   'client_id' : client_id,
   'client_secret' : client_secret
}

에러 

{'error_description': 'Grant type is not supported.',
'error': 'unsupported_grant_type',

어떻게 해결할 수 있을까요?


댓글1

  • 업데이트 된 답글입니다.

    Indigo

    파라미터값을 인코딩해서 넣어보세요.

    curl --location --request POST 'https://auth.worksmobile.com/oauth2/v2.0/token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'client_id=xxxxxxxx' \
    --data-urlencode 'client_secret=xxxxxxxx' \
    --data-urlencode 'code=xxxxxxxx' \
    --data-urlencode 'grant_type=authorization_code'

    2022.06.27

    0
이전 글Consumer token 관련 문의 드립니다.
다음 글Access Token 발급 에러 문의
목록

궁금한 점을 해결하지 못하셨나요?
지금 바로 NAVER WORKS 사용자들에게 물어보세요!