Skip to main content
Question

Grant credentials are invalid

  • May 22, 2025
  • 6 replies
  • 28 views

Forum|alt.badge.img

I have created a Client Grant type application in our company Box application.

When trying to connect to it, I am getting following error:

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"
--data-urlencode "box_subject_type=enterprise"
--data-urlencode "box_subject_id=<enterprise_id>"

On trying this, I am getting the below error:

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

Can you please let me know, what I might be missing.

My client_id is 8msnq7jz7xw38h297oewbjh4pqmcyffe

6 replies

Forum|alt.badge.img

Hey Michael, 

There is a bug I've reported to our engineering team that it looks like you've encountered. I can take care of this on the backend for you and get you up and running. Can you please tell me what the desired application access is for this application? You can take a look at the options in the configuration tab of the Developer Console: App Only or App + Enterprise. 

Best,

Kourtney, Box Developer Advocate


Forum|alt.badge.img

I would like to have enterprise access for these credentials.  


Forum|alt.badge.img

I was able to get past the error above by clicking App + Enterprise and then requesting authorization of the app in the Dev console and granting in the Admin console.

However, when I get an access token and then request the items in a folder, e.g. 127335345385, I am receiving a 404 when I would expect the service account to be able to access this folder and its child items:

{
"type": "error",
"status": 404,
"code": "not_found",
"context_info": {
"errors": [
{
"reason": "invalid_parameter",
"name": "folder",
"message": "Invalid value 'd_127335345385'. 'folder' with value 'd_127335345385' not found"
}
]
},
"help_url": "http://developers.box.com/docs/#errors",
"message": "Not Found",
"request_id": "k3y05fgq2bqhdfnp"
}

Forum|alt.badge.img

I am running into this as well. Is this still a bug?


Forum|alt.badge.img


Hi Kourtney,

Would you mind having a look at our app to see the bug is affecting us? We are having the same issue.
- App + Enterprise

- client ID:1ef9ltqp9f9ftv4dydqjius4w20072rc

 

Thanks.

 


Forum|alt.badge.img

Gosh, this product is a joke. Spent hours on forums to solve these random problems and it's either "sorry a bug" or "we changed something in our database, can yout try now?" everytime. Highly unprofessional environment and far from usable.