Skip to main content
Question

Error: Grant credentials are invalid

  • May 23, 2025
  • 1 reply
  • 14 views

Forum|alt.badge.img

Hi,

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

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

The API returned an error [BadRequest] invalid_grant - Grant credentials are invalid.

VB code:

Dim boxConfig = New BoxConfigBuilder("clientid", "secretcode").Build()
Dim boxCCG = New BoxCCGAuth(boxConfig)
Dim userToken = Await boxCCG.UserTokenAsync("userid") '; //valid for 60 minutes so should be cached and re-used
Dim userClient As IBoxClient = boxCCG.UserClient(userToken, "userid")
Dim accesstoken = userClient.Auth.Session.AccessToken

1 reply

Forum|alt.badge.img

Hello,

Can you share your client id? It might be that your are authenticating with a user id vs using the enterprise id... 

Alex, Box Developer Advocate