> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Authenticate to the CData Arc Admin API using authtokens or OAuth 2.0.

export const CommonApiAuthentication = () => <>
    <p>This example uses the authtoken header (<strong>x-cdata-authtoken</strong>) as the authentication method. To use that method:</p>
    <ol>
      <li>Click the <strong>Settings</strong> icon on the navbar.</li>
      <li>Click <strong>Add User</strong> to add a new user or click the link on an existing user's name to edit a user.</li>
      <li>Click the <strong>API Access</strong> tab, then check the <strong>API Access</strong> checkbox to display an authtoken. Copy the token to a safe place because the dialog is not shown again. If you lose or delete your authtoken, you must create a new one.</li>
      <li>Click <strong>Save</strong>.</li>
    </ol>
  </>;

export const siteName = "CData Arc";

Each configured {siteName} user has the option to authenticate to the Admin API with either an authtoken or OAuth 2.0. For more information about configuring users and user roles, see [User Management and Roles](../getting-started/administration/settings/user-roles).

## Using Authtokens

Authtokens can be used within API requests in several ways:

* Include an **x-cdata-authtoken** header in the HTTP request with the value set to an appropriate user's authtoken
* Treat the user and authtoken as a username/password combination for HTTP Basic Authentication
* Include the authtoken in the request URL as a query parameter

<CommonApiAuthentication />

To include the authtoken in the request URL, follow these steps:

1. Open the **Settings** page.

2. Select the **Admin API** tab.

3. In the **Other Settings** section, select **Allow Authtoken in URL**.

The syntax of the authtoken query parameter is `@authtoken=myAuthTokenValue`.

## Using OAuth 2.0

OAuth 2.0 provides a structured authentication flow for clients that need to manage token lifecycles or integrate with external applications.

To enable OAuth 2.0, follow these steps:

1. Click the **Settings** icon on the navbar.

2. Click **Add User** to add a new user or click the link on an existing user's name to edit a user.

3. Click the **API Access** tab, then check **Enable OAuth Access**. Complete the following fields:

   | Field             | Description                                                                                                                                       |
   | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Grant Type**    | The OAuth 2.0 grant type that determines how the client application obtains an access token. **Client Credentials** is currently the only option. |
   | **Client Id**     | The system-generated client Id token.                                                                                                             |
   | **Client Secret** | The system-generated client secret. Make sure to copy it to a safe location before saving the user, because it is not shown again.                |
   | **Access URL**    | The endpoint URL used by the client application to request an access token using the configured credentials.                                      |
