Welcome to the new Box Support website. Check out all the details here on what’s changed.

Error: Grant credentials are invalid

New post

Comments

55 comments

  • Kourtney

    Hello @Hirosuke,

    Happy to help you out here. Can you please tell me what you tried to select for application access in the Developer Console?  The options are app only access or app + enterprise access? 

    Best,

    Kourtney

    0
    Comment actions Permalink
  • Hirosuke NAMBA

    Hello Kourtney,

    Thank you for your quick reply.
    I selected "App Access Only".

    0
    Comment actions Permalink
  • Arturo Ordonez

    Hello @Kourtney. I set the initial configuration to OAuth 2.0 with Client Credentials Grant (Server Authentication)

    My app's clientId is: o0dlrw040lfrmz8d9jv3kcoa77xdzuex. I have set the application access to App + Enterprise Access. I hope that's everything you need. Thank you!

    0
    Comment actions Permalink
  • Ruben Ramirez

    Hello @Kourtney. My initial configuration is the Client Credentials Grant (Server Authentification) 

     

    My app's client id is kzd2wtczdmn178kdgsqfvgvmqve006qr and I have the App + Enterprise Access. Can you please enable permission. I keep receiving the "Grant credentials are invalid"

    0
    Comment actions Permalink
  • Arturo Ordonez

    I was able to get this working using the Authorization Code flow, but when I try using Client Credentials, I'm able to get an access token but using it results in a 404 Error. Do I need to request enterprise access even though my workplace has an enterprise account? I ask because if I were to try and use a console application to ultimately do what we need, my best bet is likely to convert my Authorization Code function into a web service the Console application can call in order to successfully make an API call itself.

    0
    Comment actions Permalink
  • Kourtney

    @Hirosuke: Thank you for confirming! Please reauthorize your app in the admin console and try again now. 

    @Ruben: This is already selected appropriately on the backend so there seems to be another issue with your request. Can you please confirm that the client id and client secret you're sending are correct and associated with the same application? 

    @Arturo: This authentication type will obtain a token for the application's service account. A 404 indicates that the user associated with your access token does not have access to the content you're trying to call. If you're not sure who your access token is associated with you can use the get current user endpoint. You will either need to obtain an access token for a user that already has access to the content or collaborate in your service account to the content. 

    0
    Comment actions Permalink
  • Namrata Dhage

    Hi, I am getting this issue {"error":"invalid_client","error_description":"The client credentials are invalid"}, after passing the correct credentials

    Could you please take a look...

    0
    Comment actions Permalink
  • Kourtney

    Hello @namrata: 

    Can you please provide the client ID of your application and what you tried to select for application access in the Developer Console?  The options are app only access or app + enterprise access. 

    0
    Comment actions Permalink
  • Namrata Dhage

    Hi, this is my client id -> 6jb3em8cpjb932pv33kshv9k0mabr91b

    I have selected Custom App and then User Authentication (OAuth 2.0)

    0
    Comment actions Permalink
  • Box User

    Hi, I am also facing this problem. I have set my app to App + Enterprise. My client id is

    de2e3ki0d9exfnk9tcppnnyjokbc5ole
     
    Thank you in advance
    0
    Comment actions Permalink
  • Kourtney

    @Namrata: If you would like to use a, client credentials grant as shown in the first post of this thread, you will need to create an app with the auth type JWT with client credentials grant. Otherwise, the only way the invalid_credentials error can surface in OAuth 2 is if the email and password combination entered is invalid. 

    @Box User: Your application does not look affected by the bug in question. I'd start by verifying that the client ID and secret are both correct and for the same application. 

    0
    Comment actions Permalink
  • Sami Luqman

    Hi, is there a fix for this issue? I am still having this problem

    client id: cv90ekrffk0ifdaibsmdnvc9sn246op7

    access level: App access only

    0
    Comment actions Permalink
  • John Herr

    Hi @Kourtney.

    Is this affecting either:

    `client_id=fgs8kfh71vaazeig5xljynv38lerw5ne`

    or

    `'client_id=g2kcz37610kbrrmko3vimror8btmuzb3`

    ?

    Thanks,
    John

    0
    Comment actions Permalink
  • Nihal Limbani

    Hi Kourtney,

    Can you please look into this matter? Having the same issue.

    1)

    Auth Method: OAuth 2.0 with Client Credentials Grant (Server Authentication)

    Client_ID: jte2rx61pddiq337dwk61kpbvulybrh7

    App Access Level: App Access Only

    2)

    Auth Method: OAuth 2.0 with JSON Web Tokens (Server Authentication)

    Client_ID: sdc5l30s0gmcgdje1wz6c794bzkbvgdb

    App Access Level: App + Enterprise Access

    3)

    Auth Method: OAuth 2.0 (User or Client Authentication)

    Client_ID: ojvskf3qzuzitlhmyxbz1ff3zkhi3c2w

     

    0
    Comment actions Permalink
  • Nicolas Reichert

    Hey Kourtney, I'm facing same issue! 

     

    Client id: cm6x78mf9dibv7nmqykq9y3lsqoal31o

    App Access Level: App Access Only

     

    Thanks! 

    0
    Comment actions Permalink
  • Rottela Suman

    Hi,

    I created app and make client credentials authentication. I am not able to download access the files and folders in admin user account.

    and i have one more issue. i shared the folders in app to user as editor he is not able download the files when he trying create access token.

    i added him as a collaborator in app i am using this for getting access token.

    curl -L -X POST "https://<companyboxurl>/oauth2/token"
    -H "Content-Type: application/x-www-form-urlencoded"
    --data-urlencode "client_id=<client_id>"
    --data-urlencode "client_secret=<client_secret>"
    --data-urlencode "grant_type=client_credentials"

    and i am getting this error

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

    can u resolve issue ASAP.

    Thanks.
    --data-urlencode "box_subject_type=user"
    --data-urlencode "box_subject_id=<user id>"

    0
    Comment actions Permalink
  • Narendra Wavhal

    Hi Kourtney

    I am also facing this error. I have set my app to App + Enterprise. My client id is

    g9tnzhjj7pfcspk1tmostf65jw2hu9l4
     
    Thank you in advance
    0
    Comment actions Permalink
  • Patryk

    I have the same issue.

    chae5tbuin233vb6x1831tohxijxzlfl

     

    0
    Comment actions Permalink
  • Solve-X

    Hi Kourtney,

    Happy New Year!

    Seems like I have the same issue.

    ClientId: g6pnmu4us74v9sk7b3ttl5v07yodyzf6

    Also, how do I select both app + enterprise access level?


    0
    Comment actions Permalink
  • Cody Antunez

    This just happened to me as well. Is there a fix that customers can do themselves?

     

    Answer to my problem: https://support.box.com/hc/en-us/community/posts/4407192479379/comments/4407333428243

     

    TLDR; i was trying to use my own userID with app only which causes error. I needed to either use a service account OR an app user (which I did not have permission to add). The documentation should be edited to reflect "user=" does not just mean YOUR user id, but specifically a service account or app user id (if you selected App access only).

    0
    Comment actions Permalink
  • WH Dev devops group

    Hello 

    I have same issuse like this post. 
    I set up app like this

    my client id is fxwqim58fbefcy9uafv56o497yowjatg

    thanks

     
    0
    Comment actions Permalink
  • Rajesh

    Hello Kourtney,

    I too am facing similar issue.

    Results:{error=invalid_grant, error_description=Grant credentials are invalid}

    Client ID : 2qqp032lws6ijjmxdbhj6oklhy5pk0ru

    access level: App access only

    Please let me know what is causing the problem.

     

    Thanks,

    ~Rajesh

     

    0
    Comment actions Permalink
  • Tim Dev BPS Lampung

    me too having same problem,

    client_id: 6ra1hjyr5uem4k4uhygtnnhqpgbsjjwh

    0
    Comment actions Permalink
  • Britt Nollé

    I am having the same issue, can someone please help/advise please:

    Client Auth success:  {'_oauth': <boxsdk.auth.ccg_auth.CCGAuth object at 0x7f84ad76e550>, '_session': <boxsdk.session.session.AuthorizedSession object at 0x7f84ad77b010>}
    Client AsUser Auth success:  {'_oauth': <boxsdk.auth.ccg_auth.CCGAuth object at 0x7f84ad76e550>, '_session':

    Upload to folder "86734036620" failed with error [
    Message: Grant credentials are invalid
    Status: 400
    URL: https://api.box.com/oauth2/token
    Method: POST
    Headers: {'Date': 'Wed, 01 Nov 2023 14:24:19 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Strict-Transport-Security': 'max-age=31536000', 'Set-Cookie': 'box_visitor_id=65425f93155745.46558765; expires=Fri, 01-Nov-2024 14:24:19 GMT; Max-Age=31622400; path=/; domain=.box.com; secure; SameSite=None, bv=PARTNERS-22119; expires=Wed, 08-Nov-2023 15:24:19 GMT; Max-Age=608400; path=/; domain=.app.box.com; secure, cn=82; expires=Fri, 01-Nov-2024 14:24:19 GMT; Max-Age=31622400; path=/; domain=.app.box.com; secure, site_preference=desktop; path=/; domain=.box.com; secure', 'Cache-Control': 'no-store', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'}]

    0
    Comment actions Permalink
  • Vimal Kumar Sindh

    Kourtney We are facing the same issue, can you please check from backend?

    ClientId: 461ruikg7bmhe827wfca67lc2kvp7wek

    0
    Comment actions Permalink

Please sign in to leave a comment.