Skip to main content
Solved

Cannot generate token using client credentials grant

  • November 6, 2024
  • 4 replies
  • 58 views

Forum|alt.badge.img

Hi there,

I cannot generate the token using the credentials grant. I can however use the temporary token from the portal to upload the file.

I am using the client credentials grant method mentioned in this URL: https://developer.box.com/guides/authentication/client-credentials/

I have double-checked the box_subject_type and box_subject_id along with client_id and client_secret. 

It used to work a couple of months ago. The error I first started noticing was 4th of October 2024. Can you please help me with this?

 

 

Best answer by pchristensen Box

Hi 

If your setting is ‘App access only’ you will not be able to generate tokens for managed users such as your own Box user. You would need to set it to App+enterprise (and re-authorize) to make this work. Also please note that if you change from ‘App access only’ to ‘App+enterprise’ you will need to re-enabled the advanced features for token generation as these are de-selected when you make the scope change. 

Rgds

Peter

 

View original
Did this topic help you find an answer to your question?

4 replies

pchristensen Box
  • Senior Staff Platform Solutions Engineer
  • 17 replies
  • November 7, 2024

Hi Sabin

 

Are you user ‘enterprise’ or ‘user’ as the subject type? If you are using ‘user’ you need to make sure that the App access level is set appropriately. With ‘App access only’ you can only generate tokens for the service account and any app user created by the service account. if the user is a managed user you’d need Enterprise access as well. (remember to re authorize the app if you make any changes)
 

Rgds

Peter Christensen, Platform Solutions Engineer, Box


Forum|alt.badge.img
  • Author
  • New Participant
  • 2 replies
  • November 12, 2024

Thanks @pchristensen Box for the response.

 

I am currently using 

box_subject_type: user

grant_type: client_credentials

 

Below is my app access level.

 

And this option is ticked as well.

And I confirm it is a service account

 

 

I didn’t make any changes, but I have sent a request to reauthorise just in case.


pchristensen Box
  • Senior Staff Platform Solutions Engineer
  • 17 replies
  • Answer
  • November 12, 2024

Hi 

If your setting is ‘App access only’ you will not be able to generate tokens for managed users such as your own Box user. You would need to set it to App+enterprise (and re-authorize) to make this work. Also please note that if you change from ‘App access only’ to ‘App+enterprise’ you will need to re-enabled the advanced features for token generation as these are de-selected when you make the scope change. 

Rgds

Peter

 


Forum|alt.badge.img
  • Author
  • New Participant
  • 2 replies
  • February 6, 2025

Thank you ​@pchristensen Box . Changing it to App + enterprise with reauthorisation fixed the issue.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings