I can’t seem to find documentation on authentication into mongodb from the C driver. The C driver API has no information on it as far as I can tell. However, this link makes me think that it’s possible. A link or a code snippet would be great. Thanks!
I can’t seem to find documentation on authentication into mongodb from the C driver.
Share
Here’s the function to call.
Here’s an excerpt from the test code as an example – mongo-c-driver/test/auth_test.c
Hope that this helps. Here are some links for futher information.
References:
MongoDB C Language Center – http://www.mongodb.org/display/DOCS/C+Language+Center
MongoDB C Driver Documentation – http://api.mongodb.org/c/current/
MongoDB C Driver API Docs – http://api.mongodb.org/c/current/api/index.html
mongo.h File Referenc – http://api.mongodb.org/c/current/api/mongo_8h.html
mongo_cmd_authenticate – http://api.mongodb.org/c/current/api/mongo_8h.html#a715aaa6b82e23486e6caad2b544f2ebf
MongoDB C Driver source code – https://github.com/mongodb/mongo-c-driver
test/auth_test.c – https://github.com/mongodb/mongo-c-driver/blob/master/test/auth_test.c