The Box SDKs have built-in support for client-side OAuth 2.0. In the process a user is redirected to the Box web app in a browser where they log in and authorize the application access to their data before they are redirected back to the applicationsDocumentation Index
Fetch the complete documentation index at: https://developer.box.com/llms.txt
Use this file to discover all available pages before exploring further.
redirect_url. This last step requires the
application to be running on a web server somewhere accessible to the user.
Overview
To complete an OAuth 2.0 flow the following steps need to be completed.- Configure the Box SDK
- Redirect the user to the Box website
- The user grants the application access
- Exchange the authorization code for an access token
The access token acquired through OAuth 2.0 is inherently tied to the user who
authorized the application. Any API call made with this token will seem to
come from this application, and the user needs to have access to any file or
folder the application tries to access with this token.
Parameters
| Parameter | Description |
|---|---|
CLIENT_ID | The client ID or API key for the application |
CLIENT_SECRET | The client secret or API secret for the application |
REDIRECT_URI | The redirect URL for your application that a user will be sent to after they have authorized the application. This can be configured in the developer console |
1. Configure SDK
The first step is to make sure your environment has been prepared with the SDK of your choice.Learn more about installing an SDK for your environment
2. Redirect user
Next, redirect the user to the authorization URL. Most of the SDKs support a way to get the authorization URL for an SDK client.The way in which a user is redirected to a URL depends on the application
framework used. Most framework documentation provides extensive guidance on
this topic.
Additional query parameters can be passed along when redirecting the user to
limit down the scope, or pass along some extra state. See the reference
documentation for more information.
3. User grants application access
Once the user is redirected to the Box web app they will have to log in. After they logged in they are presented with a screen to approve your application.
