Skip to content

Enable combined MongoDB URI and username/password properties usage #44712

Open
@mp911de

Description

@mp911de

When configuring MongoDB authentication, the configuration needs to happen either through the URI or through individual properties. Specifying spring.data.mongodb.uri ignores spring.data.mongodb.username and spring.data.mongodb.password properties as we assume the ConnectionString encapsulates all details.

In cases where endpoint config is provided with through an URL but authentication should be provided through properties (e.g. Vault, external property sources), it is not possible to do so.

In other areas, such as JDBC, some drivers can accept authentication as part of the JDBC URL and username/password properties are considered additionally.

Ideally, when both, URI and authentication, are configured, spring.data.mongodb.username overrides what is specified through the connection string.

Related tickets:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions