---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/reference/languages-and-apis/jdbc-driver/authentication.md?version=v26.1
  - https://ydb.tech/docs/ru/reference/languages-and-apis/jdbc-driver/authentication.md?version=v26.1
  - href: en/reference/languages-and-apis/jdbc-driver/authentication.md
    type: text/markdown
    title: Markdown version
  - href: ../../../llms.txt
    type: text/markdown
    title: llms.txt
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=v26.1):

* **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=v26.1#token) 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=v26.1#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=v26.1#saFile) property is configured. This method extracts the service account key from a file and uses it for authentication.