OAuth for Enterprise account

| | August 5, 2015

I’m creating a web app for my company that will keep a number of files in sync with the files on Box. This will be done by using a cron job running every hour.

I have the application working by setting the developer token in my account, this was done for testing whilst I was building the application.

Now this is working I want to get the authentication working so I can just leaving this running. So I’m trying to work out if there is a way I can have an API key for our enterprise account or if I will have to implement OAuth and connect one user to the application, which seems to be a bit overkill?

One Response to “OAuth for Enterprise account”

  1. You should probably use one of the SDKs, which take care of refreshing the tokens for you.

    Essentially what you’ll need is a keystore to store the tokens. You could store the Refresh-token only. When your cron wakes up, use the refresh token to get a new access-token and refresh-token. Store the new refresh token in your keystore. Then make your API calls using the Access-token, and then go back to sleep.

Leave a Reply