Purpose

Specifies the access token required to authenticate to a SQL Server instance for access token based Entra ID authentication. It can only be passed as a Properties or DataSource object. If an access token value is specified, the AuthenticationMethod property is automatically set to the default (AuthenticationMethod=auto). Refer to SQL Server documentation to know how to obtain an access token.

Valid Values

string

where:

string
is the access token you have obtained from Entra ID.

Notes

  • If a value for the AccessToken property is specified, the driver will ignore any other authentication method to establish a connection.
  • If accessToken is specified, driver will use encryptionMethod=SSL even if encryptionMethod is not specified or specified with "NoEncryption" option.
  • Setting accessToken is recommended using a Properties or DataSource only.

Data Source Method

public String getAccessToken()

public void setAccessToken(String)

Default

None

Data Type

String