Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rustagir committed Jun 10, 2024
1 parent ade00a5 commit 6822c37
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions source/security-and-authentication/mongodb-aws-auth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,11 @@ provider:
mongo.custom.auth.mechanism.providerClass=sample.AwsAssumeRoleCredentialProvider
mongodbaws.auth.mechanism.roleArn=arn:aws:iam::<account ID>:role/<role name>

In this example, the ``sample.AwsAssumeRoleCredentialProvider``
implementation class must be available on the classpath. The
authentication provider class reads the ARN you specify in the
``roleArn`` property.

The ``AwsAssumeRoleCredentialProvider`` class defines ``init()`` and
``validate()`` methods that are called when the connector initializes.
It returns an object of type ``com.mongodb.MongoCredential`` that is
used by the ``MongoClient``. The following code defines the custom
The ``getCustomCredential()`` method returns an object of type
``com.mongodb.MongoCredential`` that is used by the ``MongoClient``
constructed for the connector. The following code defines the custom
authentication provider:

.. code-block:: java
Expand Down Expand Up @@ -163,6 +159,11 @@ authentication provider:
}
}

In this example, the ``sample.AwsAssumeRoleCredentialProvider``
implementation class must be available on the classpath. The
authentication provider class reads the ARN you specify in the
``roleArn`` property.

To view an example of a ``pom.xml`` file that can build the complete JAR containing
the implementation class, see the `Kafka Connector GitHub repository
README file
Expand Down

0 comments on commit 6822c37

Please sign in to comment.