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

> ## Agent Instructions
> ### Authlete versions
> Authlete 3.0 is the current version. Unless the user says they use another version, answer for Authlete 3.0 using the 3.x documentation.
> Documentation for Authlete 2.x (pages under `/v2/` and `/ja/v2/`) is for the legacy version. Refer to it only when the user is on Authlete 2.x.
>
> ### Authlete architecture
> Authlete is a backend engine for OAuth 2.0 and OpenID Connect processing. End users and client applications do not call it directly; the service provider's authorization server and API server call Authlete's APIs. Authlete handles protocol processing and token, client, and service management, while the service provider owns the OAuth/OIDC endpoints and user authentication.
> See [Architecture](https://developers.authlete.com/get-started/introduction-to-authlete/architecture.md).
>
> ### Concepts
> If the user is new to Authlete, read these pages first:
> - [Request and Response](https://developers.authlete.com/get-started/concepts/request-and-response.md): Core API requests pass the client's request parameters as-is, and responses return `resultCode`, `action`, and `responseContent`.
> - [Action Handling](https://developers.authlete.com/get-started/concepts/action-handling.md): Branch on `action`, never on `resultCode`, and map each action to the HTTP response your server returns.
> - [Two-Step API Calls](https://developers.authlete.com/get-started/concepts/two-step-api-calls.md): Actions such as `INTERACTION` are completed with a second call (`/auth/authorization/issue` or `/auth/authorization/fail`) linked by a `ticket`.
> - [Management API Overview](https://developers.authlete.com/get-started/concepts/overview.md): The Management API configures services, manages clients, and operates issued tokens, separately from the protocol flows handled by the Core API.
> - [API Authentication](https://developers.authlete.com/get-started/concepts/authentication.md): Authlete APIs use bearer tokens: a Service Access Token (one service) or an Organization Token (the whole organization).

# Configuring Client Authentication

> Basics of client authentication configuration in Authlete and how client authentication works in the context of processing token requests.

> [!NOTE]
>
> For **Authlete 2.x** documentation, see [2.x version](https://developers.authlete.com/v2/protocols-and-flows/client-authentication/client-authentication.md).

## Preface

This article provides an overview of the fundamental aspects of configuring client authentication in Authlete.

## How Client Authentication Works in Authlete

Authlete performs client authentication during token requests processing ([/auth/token](https://developers.authlete.com/api-reference/token-endpoint/process-token-request.md)) by using both **pre-configured information** and **information obtained at runtime**.![client-authentication-overview](https://mintcdn.com/authlete/EJDZNZMvOu_9CJHJ/configuration-reference/endpoints/client-authentication-overview.png?fit=max\&auto=format\&n=EJDZNZMvOu_9CJHJ\&q=85\&s=e09933d61195657f678f8da8581f4fb4)

### Pre-configured Information

You will configure both an **Authlete Service** (an API instance acting as a backend of an authorization server) and a **client** in the service.

* **Authlete service**

Specify which client authentication methods are enabled by the authorization server. You can enable multiple methods at the same time.

* **Client**

Specify which one of the enabled methods is applicable for the client, registered in the service (i.e. establishing a connection with the authorization server). You may also configure information required for the authentication method (e.g. the client's public key, subject name of the client's certificate).

### Information obtained at runtime

On receiving a token request from a client, an authorization server passes the content of the request to Authlete's [/auth/token](https://developers.authlete.com/api-reference/token-endpoint/process-token-request.md) API that processes it. Authlete parses the content, detects the identity of the client, determines the pre-specified authentication method, and fulfills client authentication.

Some client authentication methods require additional information such as a value of Authorization header in HTTP request from the client to the authorization server, the client's certificate used in mutual TLS connection between the parties. In such cases, the authorization server extracts those information from the HTTP request or the mutual TLS, and sends it to Authlete, along with the content of the token request.

***

## Configuration example

This section shows an example to use **CLIENT\_SECRET\_BASIC** method to authenticate a client (ID: **1257...**) and fulfill a token request.![client-authentication-client-secret-basic](https://mintcdn.com/authlete/EJDZNZMvOu_9CJHJ/configuration-reference/endpoints/client-authentication-client-secret-basic.png?fit=max\&auto=format\&n=EJDZNZMvOu_9CJHJ\&q=85\&s=9d440735cdcfc3520b41acab56d9ed7a)

### Service Settings

The following settings are done in the pre-configuration.

To enable the `CLIENT_SECRET_BASIC` method in your service:

1. Log in to the [Authlete Management Console](https://console.authlete.com/)
2. Click on your Organization name and choose your Service.
3. Navigate to **Service Settings > Endpoints > Token**
4. Under the **Supported Client Authentication Methods** section, select the `CLIENT_SECRET_BASIC` checkbox.
5. Click Save Changes to apply the updates.

![client-authentication\_1](https://storage.googleapis.com/authlete-website/resources/kb/client-authentication/1.png)

### Client Settings

To enable the `CLIENT_SECRET_BASIC` method for your client:

1. Navigate to **Client Settings > Endpoints > Token > General**
2. Under the **Client Authentication Method** section, open the dropdown menu and select `CLIENT_SECRET_BASIC`
3. Click Save Changes to apply the updates.

![client-authentication\_2](https://storage.googleapis.com/authlete-website/resources/kb/client-authentication/2.png)

### Client ID and Client Secret in Client Basic Settings

**CLIENT\_SECRET\_BASIC** requires only “client ID” and “client secret” to authenticate the client. In Authlete, these values are automatically generated ("**1257...**" and "**gTyu...**" respectively in this example). The client administrator sets the auto-generated values to the client.

To view your Client ID and Client Secret in the Authlete Management Console:

1. Log in to the [Authlete Management Console](https://console.authlete.com/)
2. Click on your Organization name and choose your Service.
3. Navigate to **Client Settings > Basic Settings > General**

![](https://storage.googleapis.com/authlete-website/resources/kb/client-authentication/3.png)

### Client Request Flow from Start to Finish

Here are flows from a token request by the client to fulfillment by Authlete.

**Step 1**

The client prepares a token request. The request will be sent to the authorization server with information needed for client authentication. In this case, the client sets its client ID (**1257...**) and secret (**gTyu...**) to Authorization header of the HTTP request.

```http highlight={2} theme={null}
POST /token HTTP/1.1
Authorization: Basic base64(1257...:gTyu...)
Host: as.example.com
...
grant_type=authorization_code&
code=...&
redirect_uri=...
```

**Step 2**

The authorization server obtains the actual content of the token request ("grant\_type=authorization\_code&..." in this example) from body part of the HTTP request. The client's ID and secret are also extracted from the Authorization in the HTTP header part at the same time.

| Item | Value |
| - | - |
| Content of token request | `grant_type=authorization_code&code=...&redirect_uri=...` |
| Client ID | `1257...` |
| Client secret | `gTyu...` |

**Step 3**

The authorization server makes a request to Authlete's [/auth/token](https://developers.authlete.com/api-reference/token-endpoint/process-token-request.md) API. The request contains the values that have been obtained in the step 2; the content of the token request and the client's ID and secret, as "parameters", "clientId", "clientSecret" respectively.

```http highlight={6-10} theme={null}
POST /api/{Service ID}/auth/token HTTP/1.1
Host: us.authlete.com
...

{
  "clientId":"1257...",
  "clientSecret":"gTyu...",
  "parameters":
    "grant_type=authorization_code
     &code=...&redirect_uri=..."}
```

**Step 4**

By using the client's ID in the API request, Authlete determines the identity of the client that is the source of the token request. Authlete eventually recognizes that CLIENT\_SECRET\_BASIC is the method to authenticate the client, checks the value of the client's secret, and decides if the authentication is successful or not.

***

## Method Specific Configuration Tips

Both client information to be pre-configured in an Authlete service, and tasks to be done by an authorization server on receiving an token request, are different for each client authentication method.

This table describes configuration tips for some of the methods supported by Authlete.

| **Authentication Method** | **Client Behavior** | **Authlete Settings** | **Authorization Server Settings** |
| - | - | - | - |
| **CLIENT\_SECRET\_BASIC** | The client sets its ID and secret in the `Authorization` header when sending a token request. | No additional settings required; Authlete automatically generates and manages the client’s ID and secret. | Extracts the client’s ID and secret and include them as parameters in the [/auth/token](https://developers.authlete.com/api-reference/token-endpoint/process-token-request.md) |
| **CLIENT\_SECRET\_POST** | The client includes its ID and secret as parameters in the token request. | No additional settings required, similar to `CLIENT_SECRET_BASIC`. | No additional operations needed; the client’s ID and secret are part of the token request content. |
| **CLIENT\_SECRET\_JWT** | The client generates a JWT assertion containing a MAC (message authentication code) calculated using the client's secret and adds it as a parameter in the token request.  For more details, see [Client authentication using client\_secret\_jwt method](https://developers.authlete.com/configuration-reference/endpoints/client-authentication-using-client-secret-jwt-method.md) | Specify the “assertion signing algorithm” for the JWT assertion in Authlete. Authlete automatically generates and manages the client’s secret. | No additional operations needed; the JWT assertion is part of the token request content. |
| **PRIVATE\_KEY\_JWT** | The client generates a digitally signed JWT assertion using public key cryptography and adds it as a parameter in the token request. For more details, see [Client authentication using private\_key\_jwt method](https://developers.authlete.com/configuration-reference/endpoints/client-authentication-using-private-key-jwt-method.md) | You have to Specify the “assertion signing algorithm” of the JWT assertion and register the client’s public key in Authlete. | The server doesn't have to do additional operations; the JWT assertion is part of the token request content. |
| **TLS\_CLIENT\_AUTH** | The client establishes a mutual TLS connection and is authenticated using the client's  certificate obtained from the connection. For more details, see [Client authentication using tls\_client\_auth method](https://developers.authlete.com/configuration-reference/endpoints/client-authentication-using-tls-client-auth-method.md). | You have to specify the `“subject name”` of the client’s certificate in Authlete. | Extracts the client’s certificate from the mutual TLS connection and includes it as a parameter in the [/auth/token](https://developers.authlete.com/api-reference/token-endpoint/process-token-request.md). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.