MongoDB connection URL for GSSAPI authentication mechanism

44 views
Skip to first unread message

Dmitry Katsubo

unread,
Aug 31, 2017, 11:06:30 AM8/31/17
to mongodb-user
Dear community,

In reference section Connecting to MongoDB I have found a bit strange example of connection URLs for GSSAPI authentication mechanism:

val uri = MongoClientURI("mongodb://username%40do...@kdc.example.com/?authMechanism=MONGODB-GSSAPI")

It is strange that KDC is MongoDB server as well (provided I interpret this URL correctly). It could be, but it creates a confusion. This perhaps looks better:

val uri = MongoClientURI("mongodb://username%40example.com@localhost:27017/?authMechanism=MONGODB-GSSAPI")

In Phython Authentication Examples it is written:

uri = "mongodb://mongodbuser%40EXAMPL...@example.com/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myservicename"

Again, KDC domain and MongoDB server are the same and as result it's not easy to see where the user principal ends. Does this one look better?

uri = "mongodb://mongodbuser%40EXAMPL...@mongo-server.example.com/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myservicename"

Thanks for opinion.

Brian Moss

unread,
Nov 6, 2017, 8:22:16 PM11/6/17
to mongodb-user

Hi Dmitry,

Thank you very much for pointing this out. I have filed a Jira issue with a pull request to update the Python doc as you have suggested: PYTHON-1399

In regards to Casbah, the project is no longer in development. The MongoDB Scala Driver has taken its place and has Authentication documentation with more clearly defined examples for Kerberos.

Cheers,Brian

Reply all
Reply to author
Forward
0 new messages