Grant credentials are invalid

Completed
New post

Comments

12 comments

  • Official comment
    Kourtney

    Hello, 

    Please go ahead and re-try now! 

    Best, 

    Kourtney, Box Developer Advocate

    Comment actions Permalink
  • Kaustav Kundu

    Hi Kourtney,

     

    Thanks for replying. I am still getting the same error for client id ni8daktl7chhwxlt0zovndcefq4e7brc.

    However, I have another app with client id 7ficj01obo62wtckb6lk3t1qtk2u3on6 which works absolutely fine. For both the apps, all the settings and configurations are same however the first one is not working. What can be the issue?

    0
    Comment actions Permalink
  • Kourtney

    Hello, 

    Can you please reauthorize the one that's not working and then retry? 

    Best,

    Kourtney

    0
    Comment actions Permalink
  • Kaustav Kundu

    Thanks Kourtney. I will try to get the app reauthorized.

    0
    Comment actions Permalink
  • Kaustav Kundu

    Hi Kourtney,

    I have got the app reauthorized. But I am still getting the same error.

    0
    Comment actions Permalink
  • Kourtney

    Redacting your client secret, can you please show me the request you're making? 

    0
    Comment actions Permalink
  • Kaustav Kundu

    Hi,

    This is the request I am making:

    type: "POST",
    url: "https://api.box.com/oauth2/token",
    data: {
    contentType:'application/x-www-form-urlencoded',
    client_id: 'ni8daktl7chhwxlt0zovndcefq4e7brc',
    client_secret: 'xxxxxxxxxxxxxxxxxxxx',
    grant_type: 'client_credentials',
    box_subject_type: 'user',
    box_subject_id: 'xxxxxxxxxxx'
    }

    0
    Comment actions Permalink
  • Kaustav Kundu

    Hi Kourtney,

    I am getting error while making a request using this client id

    However, the request is successful while using another client id

    What could be the possible reasons for this? All the configurations in the dev console are similar.

     

     

    0
    Comment actions Permalink
  • Kourtney

    I did some testing and I was able to get client ID ni8daktl7chhwxlt0zovndcefq4e7brc to work when setting the box_subject_id to enterprise. I see the app access is set to app only. Can you confirm that the user ID you're trying to pass is for an app user and not a managed user ID? 

    0
    Comment actions Permalink
  • Kaustav Kundu

    Hi Kourtney,

    What exactly is the difference between an app user and a managed user in terms of access?

    The user id belongs to our organization and can be used to login and view files in box. Not sure if this information will help you.

    0
    Comment actions Permalink
  • Kourtney

    Great question! You can read more about app users and managed users in our user types guide

    The TLDR is that app users are only accessible via the API, meaning they do not have login credentials. 

    If you would like to access the content of managed users as well, you will need to change the application access to app + enterprise and then ensure the application is reauthorized in the Admin Console. 

    0
    Comment actions Permalink
  • Kaustav Kundu

    Hi Kourtney,

    Thanks for sharing the information.

    After going through the user guide as well as your explanation, I can conclude that the user id is a managed user id, i.e, the user id has login credentials.

    However, I cannot change the access to app + enterprise as it is not allowed in our organization. But my concern is that the APIs are behaving differently though the scope of the application and the type of user is same (as shared earlier with screenshots).

    0
    Comment actions Permalink

Please sign in to leave a comment.