With the release of MongoDB 2.6 Enterprise it is now possible to authenticate with the MongoDB server using the client's x.509 certificate. Since the identity of the client is established as part of the TLS/SSL connection the driver simply needs the full subject name from the client's x.509 certificate:
MongoClientConfiguration config = new MongoClientConfiguration("mongodb://locahost:27017/"); config.addCredential( Credential.builder() .userName("CN=common name,OU=OrgUnit,O=Org,L=Locality,ST=State,C=Country") .x509());
See the Authenticate with x.509 Certificate tutorial.
The x.509 authenticator is provided via the driver's extensions jar available to license holders. Any attempt to add a credential to a configuration using x.509 client authentication will throw an IllegalArgumentException without the extensions jar on the classpath. Please contact Allanbank Consulting, Inc. for information on licensing the driver and obtaining the extensions jar.