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.
Using a Credentials String
To configure authentication using a credentials string:
- To access authentication options, open the ODBC Data Source Administrator where you created the DSN, select the DSN, and then click Configure.
- In the Mechanism drop-down list, select Use Credentials.
- In the Credentials field, type a string that uses the following format, where [UserName] is the name of a user or a bucket and [Password] is the corresponding password:
- To encrypt your credentials, select one of the following:
- If the credentials are used only by the current Windows user, select Current User Only.
- Or, if the credentials are used by all users on the current Windows machine, select All Users Of This Machine.
- To save your settings and close the dialog box, click OK.
[{"user": "[UserName1]", "pass":"[Password1]"},
{"user": "[UserName2]", "pass":"[Password2]"}]
For example:
[{"user": "JSmith", "pass":"access123"},
{"user": "Admin", "pass":"simba123"}]
Using a Credentials File
Important:
Passwords in this file are stored unencrypted. Access to this file should be restricted accordingly.
To configure authentication using a credentials file:
- To access authentication options, open the ODBC Data Source Administrator where you created the DSN, select the DSN, and then click Configure.
- In the Mechanism drop-down list, select Use Credentials File.
- In the Credentials File field, specify the full path of a JSON file containing the appropriate credentials. You can manually type the path in the field, or click Choose Credentials File and then browse to select the file.
- To save your settings and close the dialog box, click OK.
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"}]
- Creating a Data Source Name
- Authentication Driver Configuration Options on page 1