The official Box SDKs have built-in support for JWT authentication. This guide will take you through user authentication using JWT with the use of the Box SDKs. JWT authentication is designed for working directly with the Box API without requiring a user to redirect through Box to authorize your application.Documentation Index
Fetch the complete documentation index at: https://developer.box.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
To complete a JWT authorization the following steps need to be completed.- Read the configuration file
- Initialize an SDK client
The default method of authentication through JWT is inherently tied to the Service
Account for the application. Any API call made with this token will seem to
come from this application and will not have access to files and folders from
other users without explicitly getting access them.
Prerequisites
Before we can get started, you will need to have completed the following steps.- Create a Box Application within the developer console
- Create and download the private key configuration file for your application and save it as
config.json - Ensure your Box Application is approved for usage within your enterprise
1. Read JSON configuration
After creating a Box Application there should be aconfig.json file containing
the application’s private key and other details. The following is an example.
config.json
Parsing JSONIn some programming languages there is more than one way to read and parse
JSON from a file. Refer to guides on your preferred programming language for
more complete guides, including error handling.
