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

# App Tokens with SDKs

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = localizeLink(href);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

<RelatedLinks
  title="REQUIRED GUIDES"
  items={[
{ label: translate("Authentication"), href: "/guides/authentication", badge: "GUIDE" },
{ label: translate("Setup with App Token Auth"), href: "/guides/authentication/app-token/app-token-setup", badge: "GUIDE" }
]}
/>

The official Box SDKs have built-in support for App Token authentication.

App Token authentication is designed for working directly with the
Box API without requiring a user to redirect through Box to authorize your
application, yet is restricted to the application's own data.

<Note>
  The 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 to them.
</Note>

## Prerequisites

Before we can get started, you will need to have completed the following steps.

* Create a Box Application within the developer console
* Ensure the application is configured to use App Token authentication
* Generate a primary and secondary App Token for the application and store the tokens somewhere in your code.

## Initializing an SDK client

To initialize an SDK client for app token auth, ensure the SDK is installed and
then configure the SDK as follows.

<CodeGroup>
  ```csharp .Net theme={null}
  var config = new BoxConfig("[CLIENT_ID]", "", new Uri("http://localhost"));
  var session = new OAuthSession("[APP_TOKEN]", "N/A", 3600, "bearer");
  var client = new BoxClient(config, session);
  ```

  ```java Java theme={null}
  BoxTransactionalAPIConnection api = new BoxTransactionalAPIConnection("[APP_TOKEN]");
  ```

  ```python Python theme={null}
  from boxsdk import Client, OAuth2

  auth = OAuth2(access_token='[APP_TOKEN]')
  client = Client(auth)
  ```

  ```js Node theme={null}
  var BoxSDK = require('box-node-sdk');
  var sdk = new BoxSDK({
      clientID: '[CLIENT_ID]',
      clientSecret: ''
  });

  var client = sdk.getBasicClient('[APP_TOKEN]');
  ```
</CodeGroup>

With this the application should be able to make API calls to any of the
<Link href="/guides/authentication/app-token/endpoints">endpoints</Link> enabled for App Token auth.

## Using SDKs and Application Tokens

To learn more about Application Tokens for each SDK head over to:

* [.Net][.Net]

* [Java][Java]

* [Python][Python]

* [Node][Node]

[.Net]: https://github.com/box/box-windows-sdk-v2/blob/legacy/docs/authentication.md#box-view-authentication-with-app-tokens

[Java]: https://github.com/box/box-java-sdk/blob/legacy/doc/authentication.md#box-view-authentication-with-app-token

[Python]: https://github.com/box/box-python-sdk/blob/legacy/docs/usage/authentication.md#box-view-authentication-with-app-tokens

[Node]: https://github.com/box/box-node-sdk/blob/legacy/docs/authentication.md#box-view-authentication-with-app-tokens

<RelatedLinks
  title="RELATED APIS"
  items={[
{ label: translate("Authorize user"), href: "/reference/get-authorize", badge: "GET" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Downscope a Token"), href: "/guides/authentication/tokens/downscope", badge: "GUIDE" }
]}
/>
