I am trying to configure x509 authentication for mongodb community edition. Though I have configured the same, I am able to login using server as well as client authentication along with x509 auth. Is this the normal behavior of the setup or am I making any mistakes.

Please help me on this. Thanks in advance

  • 2
    You have provided zero details of how exactly you have configured authentication or how you connect, so your question is impossible to answer.
    – mustaccio
    Commented Jan 29 at 14:59
  • You can enable clients by username/password or x509 certificate, and yes you can have both at the same time but not for the same user, of course. As you don't provide any MongoDB server configuration settings, nor any certificate properties nor the way how you connect, nobody here can answer your question. What do you mean by "I am able to login using server authentication"? Commented Jan 29 at 15:43
  • Entries from my config file: net: port: 27017 bindIp: tls: mode: requireTLS certificateKeyFile: D:\certnew\MongoDb\Test3\test-server.pem CAFile: D:\certnew\MongoDb\Test3\test-ca.pem security: authorization: enabled clusterAuthMode: x509 Commented Jan 30 at 5:16
  • Connect with server Certificate: mongosh --tls --tlsCertificateKeyFile D:\certnew\MongoDb\Test3\test-server.pem --tlsCAFile D:\certnew\MongoDb\Test3\test-ca.pem Connect with Client Certificate: mongosh --tls --tlsCertificateKeyFile D:\certnew\MongoDb\Test3\test-client.pem --tlsCAFile D:\certnew\MongoDb\Test3\test-ca.pem Trying to connect with x509 Auth: mongosh --tls --tlsCertificateKeyFile D:\certnew\MongoDb\Test3\test-client.pem --tlsCAFile D:\certnew\MongoDb\Test3\test-ca.pem --authenticationDatabase '$external' --authenticationMechanism MONGODB-X509 I want only x509 authentication Commented Jan 30 at 5:17
  • Please edit your question and add information there instead of putting it into a comment. It's very hard to read. Commented Jan 30 at 7:07


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.