> ## 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.

# Client Credentials Grant

> How Client Credentials Grant authenticates a Server app with a client ID and client secret, and which subjects it can request a token for.

**REQUIRED GUIDES**

Client Credentials Grant (CCG) is an authentication method for
Platform Apps using
**Server Authentication**. It verifies your application's identity with a client
ID and a client secret, and returns an access token without anyone signing in.
CCG is preselected for new Server apps.

## How it works

Your application posts its client ID and client secret to the
token endpoint with a
`grant_type` of `client_credentials`, along with the subject it authenticates as.
Box returns an access token that is valid for 60 minutes. No refresh token is
issued, so request a new access token when the current one expires.

Every token request names one of three subjects.

| Authenticate as | `box_subject_type` | `box_subject_id` | Also required |
| - | - | - | - |
| The application's Service Account | `enterprise` | Your enterprise ID | Nothing beyond app authorization |
| An App User | `user` | The App User's ID | **Generate User Access Tokens** |
| A Managed User or an Admin | `user` | The user's ID | **App + Enterprise Access** and **Generate User Access Tokens** |

Both settings live on the **Configuration** tab of your app in the Box
[Developer Console][devconsole], and changing them means you have to
reauthorize
the application.

> [!WARNING]
>
> Your client secret identifies your application to Box, so treat it like a
> password. Keep it out of email, public forums, code repositories, distributed
> native applications, and client-side code. See the
> authentication best practices
> for how to store and rotate it.

## Switching to JWT

If your integration requires keypair-based authentication and your enterprise
allows switching auth types, you can
change to JWT
from the **Configuration** tab at any time. If switching is disabled, the method
is set when the app is created and can't be changed later.

A free developer account gives you access to the Developer Console, where you can set up Client Credentials Grant authentication in minutes.

[https://account.box.com/signup/developer](https://account.box.com/signup/developer)
[https://account.box.com/developers/console](https://account.box.com/developers/console)

> [card] Set up an app with Client Credentials Grant

[devconsole]: https://app.box.com/developers/console

**RELATED APIS**

**RELATED GUIDES**
