user3472966
user3472966

Reputation: 15

Box v2 API java example, without user interaction

I'm developing a library that use the Box API, I'm trying to adapt the example code: Hello World My code does not interact with an end user, my library runs on a server. The example opens a browser and requests BOX user credentials, I can't do that. Could somebody show a simple example to authenticate a client BOX without any user interaction?

Thanks

Upvotes: 0

Views: 1172

Answers (1)

Peter
Peter

Reputation: 2599

Box offers a client credential grant that doesn't need a user to approve your app to get at that user's content. But since no user grants permission, you can't get to documents with it, only application settings.

What many people have done is associate a "system" Box account with their server application, and go through the authentication once for their app (manually via curl, postman, or by using http://box-token-generator.herokuapp.com/). Then store that AT/RT pair into a keystore on your server, and you never have to use the web-browser on your server. You'll can leverage the SDK to do the refreshes for you.

Upvotes: 1

Related Questions