Grant credentials are invalid

回答済み
新規投稿

コメント

6件のコメント

  • 正式なコメント
    Alex Novotny

    We will check and report back. 

    Thanks,

    Alex, Box Developer Advocate

    コメントアクション Permalink
  • Kourtney

    Hello, 

    The bug that was causing issues with Client Credentials Grant was resolved, but I did double check the backend and it looks fine for this application. 

    Can you please share the call you're making (redact the client secret)? Also, please double check that you're passing using one of the below: 

    • box_subject_type = enterprise and box_subject_id=YOUR_ENTERPRISE_ID_HERE
    • box_subject_type = user and box_subject_id = APP_USER_ ID_HERE; you cannot pass your own user ID or a managed user ID 

     Best,

    Kourtney, Box Developer Advocate

    1
    コメントアクション Permalink
  • Box User

    I’m trying to gain access through a cURL request via bash:

     

    curl --location --request POST "https://api.box.com/oauth2/token" \ 
    --header "Content-Type: application/x-www-form-urlencoded" \
    --data-urlencode "client_id=y8mb0api5yuxigwwnqsqsr3ex3at5tdm" \
    --data-urlencode "client_secret=redacted" \
    --data-urlencode "grant_type=client_credentials" \
    --data-urlencode "box_subject_type=user" \
    --data-urlencode "box_subject_id=1*******4"

    I get the error mentioning that my grant credentials are invalid. I’m following the guidelines mentioned

    Thank you for helping.

    0
    コメントアクション Permalink
  • Kourtney

    I believe you're trying to pass your own user ID into the box_subject_id, which won't work because you've selected app only as the application access. This setting means you'll only be able to pass the user ID of the app's service account or any app users. If you want to be able to use your own user ID you'll need to change to app+enterprise and then reauthorize the app in the admin console. 

    1
    コメントアクション Permalink
  • Box User

    It worked! Thank you so much for helping and sorry for being such a bother.

    0
    コメントアクション Permalink
  • Kourtney

    Wonderful to hear and definitely not a bother! This helped me update our documentation to help others in the future :) 

    1
    コメントアクション Permalink

サインインしてコメントを残してください。