p4 ldaps

Display a list of LDAP configurations or attempt to authenticate a user against active configurations.

Syntax

p4 [g-opts] ldaps [-A]
p4 [g-opts] ldaps -t username

Syntax conventions

Description

The p4 ldaps command includes two syntax variants:

  • The first variant allows you to display existing LDAP configurations; the -A option lists active configurations according to the priority set for them with the auth.ldap.order.n configurable.
  • The second variant allows you to attempt to authenticate the specified user against all active configurations. This command tests each configuration whether the authentication succeeds or fails. That is, testing does not stop with the first successful authentication.

Listing configurations

If you do not use the -A option, p4 ldaps returns information about all configurations. If a configuration has not been assigned a priority using the auth.ldap.order.n configurable, it is shown to be disabled. Output includes the configuration name, the host and port of the AD/LDAP server, the bind method used, and whether the server is enabled.

c: \temp>p4 -p 1666 ldaps
emma localhost:389 simple (disabled)
olivia localhost:389 sasl (enabled)
isabel localhost:389 search (enabled)

If you use the -A option, only enabled servers are shown, and they are listed in the order in which they will be searched. For example:

c: \temp>p4 -p 1666 ldaps -A
olivia localhost:389 search (enabled)
isabel localhost:389 sasl (enabled)

The order of the servers shown above are determined by the setting of the auth.ldap.order.n configurable; for example:

c: \temp>p4 -p 1666 configure show
auth.ldap.order.1=olivia (configure)
auth.ldap.order.2=isabel (configure)

Testing active configurations

Using the -t option allows you to test all active configurations. A test might fail because a server is unavailable, because the user could not be found, or because the wrong credentials were submitted.

  • Here is output from a successful authentication:

    c:\temp> p4 -p 1666 ldaps -t myUser
    Enter password:
    Testing authentication against LDAP configuration olivia
    Authentication successful
    Testing authentication against LDAP configuration isabel.
    Authentication successful
  • Here is output from a test that failed because the AD/LDAP servers were unavailable:

    c:\temp> p4 -p 1666 ldaps -t myUser
    Enter password:
    Testing authentication against LDAP configuration olivia.
    Failed to initialize TLS: Server Down
    Testing authentication against LDAP configuration isabel.
    Failed to initialize TLS: Server Down
  • Here is output when a bad password is given:

    c:\temp> p4 -p 1666 ldaps -t myUser
    Enter password:
    Testing authentication against LDAP configuration isabel
    Authentication as abrown failed. Reason: Invalid Credentials
    Testing authentication against LDAP configuration olivia
    Authentication as abrown failed. Reason: Invalid Credentials

Options

-A config

Display command output according to the priority set with the auth.ldap.order.n configurable. This limits the configurations displayed to those that have been assigned a priority.

If you omit this option, all active configurations are listed in alphabetical order.

-t username

Specifies a user name to authenticate against all active LDAP configurations; this option is provided for testing purposes.

g-opts

See Global options.

Usage notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

N/A

N/A

super

Examples

p4 ldaps

List all configurations.

p4 ldaps -t bruno

Authenticate the user bruno against all active configuration.

Related commands

To create, edit, delete, or test an LDAP configuration.

p4 ldap

To define LDAP-related configurables.

p4 configure