use MongoDB; use Data::Dumper; my $mdb = MongoDB->connect( 'mongodb://xxxxxxx', { username => 'xxxxx@xxxxxx.COM', auth_mechanism => 'GSSAPI', }); my $db = $mdb->get_database('testdb'); my $cfg = $db->get_collection('test_coll'); my $result = $cfg->insert_one({ name => 'test_name', test_field => 'this_is_a_test', }); my $id = $result->inserted_id(); print "Inserted: $id\n"; my $all_cfg = $cfg->find; while ( my $c = $all_cfg->next ) { print Dumper $c; } #### MongoDB::AuthError: Authentication to //xxxxxxx:27017 failed: MongoDB::AuthError: GSSAPI error: MongoDB::AuthError: Could not start GSSAPI. Did you run kinit? Error was: no mechanism available; SASL(-4): no mechanism available: No worthy mechs found; client_start error. (Callbacks?)