Configuring Authentication

Some Couchbase Server instances require authentication. In particular, if you are connecting to Couchbase Server version 5.0 or later, you must provide credentials for authentication.

To configure the Simba Couchbase ODBC Driver to pass in the necessary credentials and authenticate the connection to the database, provide a JSON string or a JSON file that specifies the name and password for one or more users or buckets.

You can use a string or a file to specify the credentials of multiple users or buckets. However, if you need to specify many sets of credentials for your connection, then it is recommended that you use a file.

You can set the connection properties described below in a connection string or in a DSN (in the odbc.ini file). Settings in the connection string take precedence over settings in the DSN.

Using a Credentials String

To configure authentication using a credentials string:

  1. Set the AuthMech property to 1.
  2. Set the CredString property to a string that uses the following format, where [UserName] is the name of a user or a bucket and [Password] is the corresponding password:
  3. [{"user": "[UserName1]", "pass":"[Password1]"},
    {"user": "[UserName2]", "pass":"[Password2]"}]

    For example:

    [{"user": "JSmith", "pass":"access123"},
    {"user": "Admin", "pass":"simba123"}]

Using a Credentials File

Important:

Important:

Passwords in this file are stored unencrypted. Access to this file should be restricted accordingly.

To configure authentication using a credentials file:

  1. Set the AuthMech property to 2.
  2. Set the CredFile property to the full path of a JSON file containing the appropriate credentials.
  3. The credentials file contains the names and passwords of multiple users or buckets, specified in the following format:

    [{"user": "[UserName1]", "pass":"[Password1]"},
    {"user": "[UserName2]", "pass":"[Password2]"}]

    For example:

    [{"user": "JSmith", "pass":"access123"},
    {"user": "Admin", "pass":"simba123"}]

  • Authentication Driver Configuration Options on page 1
  • Configuring the Driver on page 1