Welcome to the new Box Support website. Check out all the details here on what’s changed.

Comments

9 comments

  • ikatz

    I experienced the same problem. Opens a support ticket with Box on Monday. Last responce was yesterday "Our engineering team is working quickly to fix this issue". So, still waiting...

    0
    Comment actions Permalink
  • Brent

    This issue should now be resolved. Our Engineers released a fix last night. Thanks for your patience.

    0
    Comment actions Permalink
  • Box Product Support

    My selft integrating with php and get the same error {"error":"invalid_request","error_description":"Cannot obtain token based on the enterprise configuration for your app"} Any body help me?

    0
    Comment actions Permalink
  • oztexan

    Getting:

    "error": "invalid_request",
    "error_description": "Cannot obtain user token based on the enterprise configuration for your app"

    The app user is valid.  

    The app is configured for Enterprise access.  

     

    let client = sdk.getAppAuthClient('user', '');

    client.files.get('', null, (err, info) => {
    console.log("INFO: "+JSON.stringify(info));
    console.log("ERR: "+JSON.stringify(err));
    });

     

     What am I missing?

    0
    Comment actions Permalink
  • oztexan

    Update:... 


    I setup another box account (business trial), created new app with Enterprise access and then authorised it under Admin.  

    Created a new app user through the API, no problem. 

    Attempted to retrieve contents of root folder as follows:

    let client = sdk.getAppAuthClient('user', userid);

    client.folders.get('0', null, (err, info) => {
    console.log("INFO: "+JSON.stringify(info));
    console.log("ERR: "+JSON.stringify(err));
    });

    Got same error: "Cannot obtain user token based on the enterprise configuration for your app"

     

    Threw up my hands.... Then went back into admin panel and randomly reauthorized the app.

     

    Success!  

    Is there a edge case bug, first authorisation not currently working?

    0
    Comment actions Permalink
  • phaattran

    Did you delete authorization completely and then re-add authorization?

    Or did you just use the "re-authorize your app" feature?

     

    I'm stuck in the same spot. Created app users successfully.

    Set access to "Only App Users of this App". but when I try to call getAppUserTokens(),

    it gives the error like above.

    0
    Comment actions Permalink
  • vdudi

    Hello guys,

     

    I am also getting the same error, let me know.

     

    Exception in thread "main" com.box.sdk.BoxAPIException: The API returned an error code: 400
    {"error":"invalid_request","error_description":"Cannot obtain user token based on the enterprise configuration for your app"}

     

    0
    Comment actions Permalink
  • spilafis

    Hi, I my case was able to resolve this issue by finding a user and using that user to access the folder.

    The app needs to have permission to Generate User Access Token, use Enterprise access, have access to Read and Write all files and still the user needs to have acess to the folder, using JWT.

    It looks like the problem I was having was that the "current" (jwt) user of the app, or the user that was related to the creation of the app which seemed to be a special user, could not be used to access content.
    So either trying to get a user token for that user or trying to access folders was causing errors:
    "Cannot obtain user token based on the enterprise configuration for your app" when trying to get a user token.
    "Invalid value 'd_.... 'folder' with value 'd_...' not found" when trying to query a folder.

    What I did was, knowing a user that had access to the folder, use get all users ( https://developer.box.com/v2.0/docs/get-all-users ) sending the filter_term param to find that user id, and then generate a user token for that user id, and use the content api with that token.
    That finally worked.

    0
    Comment actions Permalink
  • sandokan87

    Reauthorizing the app solved all issues for me.

    0
    Comment actions Permalink

Please sign in to leave a comment.