mctestauth

  • reference
March 16, 2025
+ 12
The mctestauth tool allows you to troubleshoot authentication issues in data services.

Description

The mctestauth tool allows you to troubleshoot the authentication issues in data services. Data services use the Simple Authentication and Security Layer (SASL) framework for authentication and provide you access to use the underlying mechanisms. For example, SCRAM-SHA512 or PLAIN.

The tool is located as follows:

Platform Location

Linux

/opt/couchbase/bin/mctestauth

Windows

C:\Program Files\Couchbase\Server\bin\mctestauth.exe

Mac OS X

/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/mctestauth

Syntax

mctestauth [options]

The options are as follows:

Options Description

--host with parameter <hostname[:port]>

The name of the host (with an optional port) to connect to. For IPv6, use [address]:port if you need to specify the port.

--user <username>

The username to be used in authentication.

--password <password>

The password to be used in authentication.

--tls

Optionally, use TLS to authenticate.

--ipv4

Connect over IPv4.

--ipv6

Connect over IPv6.

--version

Find program version.

--no-color

Print output without any colors.

--help

Display help text.

Example

The following call tries to connect to the data server running on the host 192.168.86.101. The call then tries the various authentication mechanisms supported by the server and prints out the result of each mechanism. The call succeeds only if you provide the correct credentials.

./mctestauth --host 192.168.86.101 --user jones --password password

If successful, the command returns output as follows:

    SCRAM-SHA512: OK
    SCRAM-SHA256: OK
    SCRAM-SHA1: OK
    PLAIN: OK

If jones was defined as an external user in LDAP, the output is as follows:

    SCRAM-SHA512: FAILED
    SCRAM-SHA256: FAILED
    SCRAM-SHA1: FAILED
    PLAIN: OK