Unable to get access token using Box API
Hi, I am using Standard OAuth 2.0 (User Authentication) in my box app.
I am trying use api https://developer.box.com/reference/post-oauth2-token/ to fetch access token
Here is my request
http POST https://api.box.com/oauth2/token client_id=701unzvyjs3289mabkq1ftk0ugjg6ssa client_secret=REDACTED grant_type=client_credentials box_subject_id=638106 box_subject_type=enterprise
I am getting error
{
"error": "unauthorized_client",
"error_description": "The \"box_subject_type\" value is unauthorized for this client_id"
}
I am not sure what I am doing wrong. Is there some setting I am missing here?
-
HI
To use the 'client credentials' grant type you have to have client credentials type app. See https://developer.box.com/guides/authentication/client-credentials/client-credentials-setup/
The call you are making with the grant type 'enterprise' is designed to provide a token for the service account (automation user) that is created when your client credentials grant app is authorised by your admin. Standard OAuth 2.0 user based apps do not support this type of credentials.
Best regards
Peter Christensen, Platform Solutions Engineer, Box
Post is closed for comments.
Comments
1 comment