MongoDB Connector

Last modified 21 Jan 2025 13:47 +01:00

MongoDB connector for midPoint IDM.

Functionalityunknown
Development statuscommunity (maintained by community effort)
Support statuscommunity
OriginInalogy
Support provided byInalogy
Target systemsMongoDB
ProtocolREST API
Source codehttps://github.com/inalogy/mongodb-connector
Documentationhttps://github.com/inalogy/mongodb-connector

MongoDB connector for midPoint IDM.

Capabilities and Features

Schema

YES

Dynamic

Provisioning

YES

Live Synchronization

YES

Password

YES

Activation

YES

Simulated

Script execution

NO

Dynamic Schema

The connector uses a dynamic schema based on the templateUser document. This template defines all attributes and their data types, serving as the foundation for the ICF ConnId schema.

Important: templateUser should be protected to avoid accidental overwrite, or made read-only.

Key Points

Required Template: The templateUser must define all attributes to be processed by the connector.

Attribute Types: Each attribute must have a defined type (e.g., String, Boolean, Integer, or List for multivalued attributes).

Multivalued Attributes: Only one-dimensional arrays with elements of the same type are supported.

MongoDB Database Configuration

keyColumn represents icfs:name.

MongoDB _id is represented by icfs:uid.

Supported Attributes/Data Types

Feature Supported Example

Array Depth

Depth of 1 (One-dimensional arrays)

["val1", "val2", "val3"]

Nested Arrays

Not supported

[["val1a", "val1b"], ["val2a", "val2b"]]

Data Types

Supported

String, Boolean, Integer

Maps (Key-Value Pairs)

Not supported

{ "key1": "value1", "key2": "value2" }

Database Setup

  1. Create Database → Create Collection → Create systemUser.

  2. In the collection, create templateUser, which the connector uses to create the schema. Ensure that your template user has all fields populated with appropriate data. Null values in the database are treated as String data type.

  3. In connectorConfiguration, define keyColumn which will represent shadow’s icfs:name attribute, for example: username.

  4. In the database, create an index for the attribute specified in step 3. This is crucial; otherwise, the connector won’t be able to determine if an account is present in the database.

db.idmUsers.createIndex( { "username": 1 }, {unique: true})

Connector Configuration

Required Properties

Property Description

Host

Host address of the MongoDB instance.

Database

Name of the MongoDB database to connect to.

Port

Port number of the MongoDB instance.

Username

Username for authentication.

KeyColumn

Name of the column used as the unique identifier (key).

Password

Password for authentication.

Collection

Name of the MongoDB collection to use.

TemplateUser

A JSON structure defining the schema. All attributes must be populated with appropriate data types.

Optional Properties

Property Description

PasswordColumnName

Name of the column in the database where passwords are stored.

AdditionalHosts

Additional MongoDB hosts (comma-separated) for replica set connections.

UseTLS

Enables TLS for secure connections (true or false).

ReplicaSet

Name of the MongoDB replica set, if applicable.

ReadPreference

Specifies the read preference for MongoDB queries (e.g., primary, secondary).

W

Write concern level (e.g., 0,1, majority).

Journal

Enables journaling (true or false).

idmUpdatedAt

Attribute name where the update timestamp will be stored (must be defined in TemplateUser). Injected at connector level.

LiveSync

Configurable through the connector configuration property liveSyncAttributeName. In MongoDB, it must be defined as ISODate.

JavaDoc

JavaDoc can be generated locally with this command:

mvn clean javadoc:javadoc

Build

mvn clean install

Build Without Tests

mvn clean install -DskipTests=True

After a successful build, you can find connector-mongodb-{versionNumber}.jar in the target directory.

Was this page helpful?
YES NO
Thanks for your feedback