新しいBoxサポートサイトへようこそ。 変更点の詳細はこちらをご確認ください .

Grant credentials are invalid

回答済み
新規投稿

コメント

11件のコメント

  • 正式なコメント
    Alex Novotny

    We will check and report back. 

    Thanks,

    Alex, Box Developer Advocate

    コメントアクション 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. 

    2
    コメントアクション 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
  • Kourtney

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

    1
    コメントアクション Permalink
  • Mobile dev

    Hello,

    I'm facing the same issue. I'm trying to use a .net application to access Box according to this guide  , but when I run it , will appear "Box.V2.Core: The API returned an error [BadRequest] invalid_grant - Grant credentials are invalid." . For the App Access Level I'm using "App + Enterprise Access" . My code is in following part. could you provide some help? 

                    var boxConfig = new BoxConfigBuilder("MyclientID", "MysecretID")
                    .SetEnterpriseId("MyEnterpriseID")
                    .Build();
                    var boxCCG = new BoxCCGAuth(boxConfig);
                   var adminToken = await boxCCG.AdminTokenAsync();

     

    Best Regards,

    Eden

    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
  • Box User

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

    0
    コメントアクション Permalink
  • Nidhi Joshi

    Hi All,

    Getting "Grant credentials are invalid" error.

    Client ID : 0ahcovdzholujrpt39uh42r95i6i979m

    App access level is - App only access

    Authentication method is - OAuth 2.0 with Client Credentials Grant (Server Authentication)

    I also wanted to ask one thing that the app which I have created ia not authorized by the box Admin. Is this why I am getting this error. Please help ASAP.

    Thanks in advance.

     

    0
    コメントアクション Permalink
  • Yuki Kakegawa

    I seem to have the same issue...!

    0
    コメントアクション Permalink
  • Govind raju

    Hi Kourtney,

     

    I am facing same issue

    {
        "error": "invalid_grant",
        "error_description": "Grant credentials are invalid"
    }

     

    my client id: 

     

    curl -i -X POST "https://api.box.com/oauth2/token" \
         -H "Content-Type: application/x-www-form-urlencoded" \
         -d "client_id=laxwqvlbbb61zkz7oj1np4d2dvsy8fes" \
         -d "client_secret=********" \
         -d "grant_type=client_credentials" \
         -d "box_subject_type=user"  \
         -d "box_subject_id=2473***36"

     

    Access: App+Enterprise level

     

    Also tried both app and app+enterprise but both option not worked. Can you please provide suggestion on this?

     

    Thank you

    Govindh

    0
    コメントアクション Permalink
  • Mike Hunigan

    Same here: nx5hjy62mrunmuqkk4dcvtwvad578kvl

    0
    コメントアクション Permalink

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