Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

Not Authenticate

New post

Comments

5 comments

  • Alex Novotny

    Hello, 

    It looks like you set up your app to be App + Enterprise set up... is this correct?

    I believe you need to pass in the enterprise id... not a user id.. can you try and report back? 

    Thanks, 

    Alex, Box Developer Advocate

    0
    Comment actions Permalink
  • Integración Box MELGEG

    Yes, it is like that, but indicating the company ID, we cannot access either

    This is the error

     

     

    thank you very much for your help

    0
    Comment actions Permalink
  • Alex Novotny

    I think I see the issue... there are two cca java methods... and you are still using the user one... below is the enterprise one to try

    BoxCCGAPIConnection api = BoxCCGAPIConnection.applicationServiceAccountConnection(
        "client_id",
        "client_secret",
        "enterprise_id"
    );

    0
    Comment actions Permalink
  • Integración Box MELGEG

    Alex, thank you very much for your answer.

    I had to wait a few days for the app to be authorized in Box to try again. Finally today they have authorized it, the authentication occurs without error, however my new problem is that I cannot read the folders that I have in Box.

    This is an extract of my code:

     

     

    This line occurs without error:

    BoxCCGAPIConnection api = BoxCCGAPIConnection.applicationServiceAccountConnection(ID_CLIENTE, SECRET_CLIENT, ENTERPRISE_ID);

    However when I try to loop through the folders, this line gives me the result that I don't have any BoxItem.Info

    for (BoxItem.Info itemInfo : folder) {

     

    0
    Comment actions Permalink
  • Alex Novotny

    So, when you use CCA as the authentication type, a service account is automatically created... and that account has its own content - which since its new probably has no content. In order to see your users content, you would want to make an as-user call, which allows the app to impersonate your user account. 

    0
    Comment actions Permalink

Post is closed for comments.