Box Groovy Wrapper

Currently this project is just a POC to test of Java BOX SDK

Notes on app integration steps

The process to create a new app and integrate using AppUsers is summarized here. Steps prefixed with (Integrator) are to be done by App owner, those prefixed by (Admin) are to be done by the Instance administrator.

  1. (Integrator) Setup dev account: https://docs.box.com/v2.0/docs/configuring-box-platform: (steps 1, 2). Need to be done only once

  2. (Integrator) Setup application: https://docs.box.com/v2.0/docs/configuring-box-platform: (step 3) Steps 1 and 2 need to be done only once

  3. (Admin) Authorize the app in the target account/repository using the API KEY of the newly created app: https://docs.box.com/v2.0/docs/configuring-box-platform: (step 4)

  4. (Integrator) Create RSA KeyPair: ref (Step 1)

    openssl genrsa -aes256 -out private_key.pem 2048
    openssl rsa -pubout -in private_key.pem -out public_key.pem
  5. (Integrator) Add public key in the created application: ref (Step 2)

  6. (Integrator) Generate an JWT enterprise auth token: use EnterpriseAPIConnection.generateEnterpriseTokenRequest(…​). Note that to do that, the private key needs to be converted with the following command:

    openssl pkcs8 -topk8 -inform PEM -outform DER -in private_key.pem -nocrypt > pkcs8_key
    Note
    The enterpriseId can be obtained from the "Enterprise Settings"/"Business Settings" (depending on account type), under the cog options in the Admin panel.
  7. (Integrator) Authenticate the token obtained in the previous step: ref, Step 6

OPTIONAL: use this to decrypt the key openssl rsa -in zecm_private_key.pem -check > private_key_dec.pem

TODO: * Create with simple metadata * Manage Metadata Templates * Download content