---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ydb.tech/docs/en/reference/languages-and-apis/jdbc-driver/authentication.md?version=main
  - https://ydb.tech/docs/ru/reference/languages-and-apis/jdbc-driver/authentication.md?version=main
sourcePath: en/core/reference/languages-and-apis/jdbc-driver/authentication.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# Authentication modes

The JDBC Driver for YDB supports the following [authentication modes](https://ydb.tech/docs/en/reference/ydb-sdk/auth.md?version=main):

* **Anonymous** is used when a username and password are not specified and no other authentication properties are configured. No authentication credentials are provided.

* **Static credentials** are used when a username and password are specified.

* **Access token** is used when the [`token`](https://ydb.tech/docs/en/reference/languages-and-apis/jdbc-driver/properties.md?version=main#token) or [`tokenFile`](https://ydb.tech/docs/en/reference/languages-and-apis/jdbc-driver/properties.md?version=main#tokenFile) property is configured. This authentication method requires a YDB authentication token, which can be obtained by executing the following YDB CLI command: `ydb auth get-token`.

* **Metadata** is used when the [`useMetadata`](https://ydb.tech/docs/en/reference/languages-and-apis/jdbc-driver/properties.md?version=main#useMetadata) property is set to `true`. This method extracts the authentication data from the metadata of a virtual machine, serverless container, or serverless function running in a cloud environment.

* **Service Account Key** is used when the [`saFile`](https://ydb.tech/docs/en/reference/languages-and-apis/jdbc-driver/properties.md?version=main#saKeyFile) property is configured. This method extracts the service account key from a file and uses it for authentication.