Interface CredentialConfig


public interface CredentialConfig
Configures the credentials and authentication mechanism to connect to the MongoDB server.
  • Method Details

    • username

      Optional<String> username()
      Configures the username.
    • password

      Optional<String> password()
      Configures the password.
    • authMechanism

      Optional<String> authMechanism()
      Configures the authentication mechanism to use if a credential was supplied. The default is unspecified, in which case the client will pick the most secure mechanism available based on the sever version. For the GSSAPI and MONGODB-X509 mechanisms, no password is accepted, only the username. Supported values: null or GSSAPI|PLAIN|MONGODB-X509|SCRAM_SHA_1|SCRAM_SHA_256|MONGODB_AWS
    • authSource

      Optional<String> authSource()
      Configures the source of the authentication credentials. This is typically the database where the credentials have been created. The value defaults to the database specified in the path portion of the connection string or in the 'database' configuration property. If the database is specified in neither place, the default value is admin. This option is only respected when using the MONGO-CR mechanism (the default).
    • authMechanismProperties

      @ConfigDocMapKey("property-key") Map<String,String> authMechanismProperties()
      Allows passing authentication mechanism properties.
    • credentialsProvider

      The credentials provider name
    • credentialsProviderName

      The credentials provider bean name.

      This is a bean name (as in @Named) of a bean that implements CredentialsProvider. It is used to select the credentials provider bean when multiple exist. This is unnecessary when there is only one credentials provider available.

      For Vault, the credentials provider bean name is vault-credentials-provider.