> For the complete documentation index, see [llms.txt](https://developer.securecontainerrelease.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.securecontainerrelease.com/getting-started/authentication/method..md).

# Method.

Setting the Authentication Method for the API

In the **`configuration.json`** file (located in **`api`** directory), there is an **`authentication`** setting. You can choose the preferred authentication method:

1. **No authentication** - remove the line:

```json
"authentication": "publicKey.pem",
```

2. **Public/Private key authentication** - specify the `.pem` file with the public key:

```json
"authentication": "publicKey.pem",
```

3. **Secret-based authentication** - create a file containing the secret and specify the filename:

```json
"authentication": "secret.txt",
```

Ensure that the file contains only the secret (no newlines). For example, you can create it on Linux:

```bash
echo -n 'secret' > secret.txt
```

After updating the configuration, restart the API service to apply the changes.

#### JWT Token Guidelines

Please take into consideration these guidelines when generating the JWT token:

* the expiration date should be included as an **integer**, not a string;
* the secret has to be **base64** encoded in the token;
* the token should be encoded with **base64URL**.

{% hint style="info" %}
You can also to [set the authentication method directly in the configuration file.](/getting-started/authentication/using-the-configuration-file..md#set-authentication-endpoint-in-configuration-file)
{% endhint %}
