Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Authentication with SSPI worked

  • Loading branch information...
commit f5af4800aadf3202b03b742cfcf5ea8f341a219a 1 parent f0f16ea
Christian Amor Kvalheim authored April 02, 2013
2  lib/mongodb/auth/mongodb_gssapi.js
@@ -60,7 +60,7 @@ var GSSAPIInitialize = function(db, username, password, authdb, connection, call
60 60
   // Right let's get sasl going
61 61
   var connection = db.serverConfig.checkoutWriter();
62 62
   // Create connection string
63  
-  var kerberos_connection_string = format("mongodb@%s", db.serverConfig.host);
  63
+  var kerberos_connection_string = format("mongodb@%s", connection.socketOptions.host);
64 64
   // Start the kerberos process
65 65
   kerberos.authGSSClientInit(kerberos_connection_string, Kerberos.GSS_C_MUTUAL_FLAG, function(err, context) {
66 66
     if(err) return callback(err, false);
483  lib/mongodb/auth/mongodb_sspi.js
... ...
@@ -0,0 +1,483 @@
  1
+var DbCommand = require('../commands/db_command').DbCommand
  2
+  , utils = require('../utils')
  3
+  , format = require('util').format;
  4
+
  5
+// Kerberos class
  6
+var Kerberos = null;
  7
+// Try to grab the Kerberos class
  8
+try {
  9
+    Kerberos = require('kerberos').Kerberos
  10
+  , SecurityCredentials = require('kerberos').SSPI.SecurityCredentials
  11
+  , SecurityContext = require('kerberos').SSPI.SecurityContext
  12
+  , SecurityBuffer = require('kerberos').SSPI.SecurityBuffer
  13
+  , SecurityBufferDescriptor = require('kerberos').SSPI.SecurityBufferDescriptor;
  14
+} catch(err) {}
  15
+
  16
+// console.log("-------------------------------------------------------")
  17
+// console.dir(SecurityContext)
  18
+// console.dir(SecurityContext.initialize)
  19
+// console.dir(new SecurityContext())
  20
+
  21
+var authenticate = function(db, username, password, authdb, options, callback) {
  22
+  var numberOfConnections = 0;
  23
+  var errorObject = null;  
  24
+  // We don't have the Kerberos library
  25
+  if(Kerberos == null) return callback(new Error("Kerberos library is not installed"));
  26
+
  27
+  if(options['connection'] != null) {
  28
+    //if a connection was explicitly passed on options, then we have only one...
  29
+    numberOfConnections = 1;
  30
+  } else {
  31
+    // Get the amount of connections in the pool to ensure we have authenticated all comments
  32
+    numberOfConnections = db.serverConfig.allRawConnections().length;
  33
+    options['onAll'] = true;
  34
+  }
  35
+
  36
+  var connection = db.serverConfig.allRawConnections()[0];
  37
+
  38
+  var command = {
  39
+      saslStart: 1
  40
+    , mechanism: 'GSSAPI'
  41
+    , payload: ''
  42
+    , autoAuthorize: 1
  43
+  };
  44
+
  45
+  // Execute first sasl step
  46
+  db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  47
+    if(err) return callback(err);
  48
+    doc = doc.documents[0];
  49
+
  50
+    console.log("=========================================================");
  51
+    console.log("========= authenticate 0");
  52
+    console.log("=========================================================");
  53
+    console.dir(err);
  54
+    console.dir(doc);
  55
+
  56
+    // Aquire security credentials
  57
+    var security_credentials = SecurityCredentials.aquire_kerberos(username, password);
  58
+    console.log("=========================================================");
  59
+    console.log("========= security credential 0");    
  60
+    console.log("=========================================================");
  61
+    console.dir(security_credentials)
  62
+
  63
+    // Set up service principal
  64
+    var target = format("mongodb/%s", connection.socketOptions.host);
  65
+    // Initialize the security context
  66
+    console.dir(doc)
  67
+    console.log("=========================================================");
  68
+    console.log("========= security context 0")
  69
+    console.log("=========================================================");
  70
+    var security_context = SecurityContext.initialize(security_credentials, target, doc.payload);
  71
+    console.dir(security_context.payload)
  72
+
  73
+    // Perform the next step against mongod
  74
+    var command = {
  75
+        saslContinue: 1
  76
+      , conversationId: doc.conversationId
  77
+      , payload: security_context.payload
  78
+    };
  79
+
  80
+    // Execute the command
  81
+    db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  82
+      if(err) return callback(err);
  83
+      doc = doc.documents[0];
  84
+
  85
+      console.log("=========================================================");
  86
+      console.log("========= authenticate 1");
  87
+      console.log("=========================================================");
  88
+      console.dir(err);
  89
+      console.dir(doc);
  90
+      // Let's perform a step
  91
+      security_context.initialize(target, doc.payload);
  92
+      console.log("=========================================================");
  93
+      console.log("========= security context 1")
  94
+      console.log("=========================================================");
  95
+      console.dir(security_context.payload)
  96
+
  97
+      // Perform the next step against mongod
  98
+      var command = {
  99
+          saslContinue: 1
  100
+        , conversationId: doc.conversationId
  101
+        , payload: security_context.payload
  102
+      };
  103
+
  104
+      // Execute the command
  105
+      db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  106
+        if(err) return callback(err);
  107
+        doc = doc.documents[0];
  108
+        
  109
+        console.log("=========================================================");
  110
+        console.log("========= authenticate 2");
  111
+        console.log("=========================================================");
  112
+        console.dir(err);
  113
+        console.dir(doc);
  114
+
  115
+        var messageLength = 0;
  116
+        // Get the raw bytes
  117
+        var encryptedBytes = new Buffer(doc.payload, 'base64');
  118
+        var encryptedMessage = new Buffer(messageLength);
  119
+        // Copy first byte
  120
+        encryptedBytes.copy(encryptedMessage, 0, 0, messageLength);
  121
+        console.log("================================== decryptMEssage")
  122
+        console.dir(encryptedMessage)
  123
+
  124
+        var securityTrailerLength = encryptedBytes.length - messageLength;
  125
+        var securityTrailer = new Buffer(securityTrailerLength);
  126
+        encryptedBytes.copy(securityTrailer, 0, messageLength, securityTrailerLength);
  127
+
  128
+        var buffers = [
  129
+            new SecurityBuffer(SecurityBuffer.DATA, encryptedBytes)
  130
+          , new SecurityBuffer(SecurityBuffer.STREAM, securityTrailer)
  131
+        ];
  132
+
  133
+        console.log("****************************************************")
  134
+        console.dir(encryptedBytes)
  135
+        console.dir(securityTrailer)
  136
+
  137
+        var descriptor = new SecurityBufferDescriptor(buffers);
  138
+
  139
+
  140
+        // Decrypt the message
  141
+        security_context.decryptMessage(descriptor);
  142
+        console.log("=========================================================");
  143
+        console.log("========= security context 2")
  144
+        console.log("=========================================================");
  145
+        console.dir(security_context.payload)
  146
+
  147
+        var length = 4;
  148
+        if(username != null) {
  149
+          length += username.length;          
  150
+        }
  151
+
  152
+        var bytesReceivedFromServer = new Buffer(length);
  153
+        bytesReceivedFromServer[0] = 0x01;  // NO_PROTECTION
  154
+        bytesReceivedFromServer[1] = 0x00;  // NO_PROTECTION
  155
+        bytesReceivedFromServer[2] = 0x00;  // NO_PROTECTION
  156
+        bytesReceivedFromServer[3] = 0x00;  // NO_PROTECTION        
  157
+
  158
+        if(username != null) {
  159
+          var authorization_id_bytes = new Buffer(username, 'utf8');
  160
+          authorization_id_bytes.copy(bytesReceivedFromServer, 4, 0);
  161
+        }
  162
+
  163
+        console.log(bytesReceivedFromServer.toString('base64'))
  164
+        console.log("=========================================================");
  165
+        console.log("========= security context 3")
  166
+        console.log("=========================================================");
  167
+        // Get the sizes
  168
+        var sizes = security_context.queryContextAttributes(0x00);
  169
+        console.dir(sizes)
  170
+
  171
+        var buffers = [
  172
+            new SecurityBuffer(SecurityBuffer.TOKEN, new Buffer(sizes.securityTrailer))
  173
+          , new SecurityBuffer(SecurityBuffer.DATA, bytesReceivedFromServer)
  174
+          , new SecurityBuffer(SecurityBuffer.PADDING, new Buffer(sizes.blockSize))
  175
+        ]
  176
+
  177
+        var descriptor = new SecurityBufferDescriptor(buffers);
  178
+
  179
+        // Encrypt the data
  180
+        security_context.encryptMessage(descriptor, 0x80000001);
  181
+        console.log("=========================================================");
  182
+        console.log("========= security context 4")
  183
+        console.log("=========================================================");
  184
+        console.dir(security_context.payload)
  185
+
  186
+        // Perform the next step against mongod
  187
+        var command = {
  188
+            saslContinue: 1
  189
+          , conversationId: doc.conversationId
  190
+          , payload: security_context.payload
  191
+        };
  192
+
  193
+        // Execute the command
  194
+        db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  195
+          console.log("=========================================================");
  196
+          console.log("========= authenticate 3");
  197
+          console.log("=========================================================");
  198
+          console.dir(err);
  199
+          console.dir(doc);
  200
+          // if(err) return callback(err);
  201
+          // doc = doc.documents[0];
  202
+        });        
  203
+      });
  204
+    });
  205
+
  206
+    // // console.dir(new SecurityContext())
  207
+    // console.dir(new SecurityContext().encryptMessage)
  208
+    // // console.dir(security_context.initialize)
  209
+    // // console.dir(security_context.payload)
  210
+    // // console.dir(security_context.encryptMessage )
  211
+    // console.dir(new SecurityBuffer(SecurityBuffer.DATA, 100).toBuffer);
  212
+  });
  213
+
  214
+
  215
+  return
  216
+
  217
+
  218
+  var numberOfConnections = 0;
  219
+  var errorObject = null;  
  220
+  // We don't have the Kerberos library
  221
+  if(Kerberos == null) return callback(new Error("Kerberos library is not installed"));
  222
+
  223
+  if(options['connection'] != null) {
  224
+    //if a connection was explicitly passed on options, then we have only one...
  225
+    numberOfConnections = 1;
  226
+  } else {
  227
+    // Get the amount of connections in the pool to ensure we have authenticated all comments
  228
+    numberOfConnections = db.serverConfig.allRawConnections().length;
  229
+    options['onAll'] = true;
  230
+  }
  231
+
  232
+  console.log("=================================== SSPI")
  233
+
  234
+  var connection = db.serverConfig.allRawConnections()[0];
  235
+
  236
+  var command = {
  237
+      saslStart: 1
  238
+    , mechanism: 'GSSAPI'
  239
+    , payload: ''
  240
+    , autoAuthorize: 1
  241
+  };
  242
+
  243
+  // Execute first sasl step
  244
+  db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  245
+    // console.log("========= authenticate 0");
  246
+    // console.dir(err);
  247
+    // console.dir(doc);
  248
+
  249
+    doc = doc.documents[0];
  250
+
  251
+    var kerberos = new Kerberos();
  252
+    console.dir(kerberos.acquireAlternateCredentials(username, password));
  253
+    // Target
  254
+    var target = format("mongodb/%s", connection.socketOptions.host);
  255
+    // Get payload
  256
+    var payload = kerberos.prepareOutboundPackage(target);
  257
+    // console.log("========= authenticate 1");
  258
+    // console.log(payload);
  259
+    console.log("============================== payload sspi")
  260
+    console.log(payload)
  261
+
  262
+    // // Perform initiate context
  263
+    // console.dir(kerberos.prepareOutboundPackage(target));
  264
+  
  265
+    // Build Authentication command to send to MongoDB
  266
+    var command = {
  267
+        saslContinue: 1
  268
+      , conversationId: doc.conversationId
  269
+      , payload: payload
  270
+    };
  271
+
  272
+    // Execute the command
  273
+    db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  274
+      // console.log("========= authenticate 2");
  275
+      // console.dir(err);
  276
+      // console.dir(doc);
  277
+
  278
+      doc = doc.documents[0];
  279
+      payload = doc.payload;
  280
+      console.log("============================== payload mongodb")
  281
+      console.log(payload)
  282
+
  283
+      var payload = kerberos.prepareOutboundPackage(target, payload);
  284
+      // console.log("========= authenticate 3");
  285
+      // console.log(payload)
  286
+
  287
+      console.log("============================== payload sspi")
  288
+      console.log(payload)
  289
+
  290
+      var command = {
  291
+          saslContinue: 1
  292
+        , conversationId: doc.conversationId
  293
+        , payload: ''
  294
+      };
  295
+
  296
+      db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  297
+        // console.log("========= authenticate 4");
  298
+        // console.dir(err);
  299
+        // console.dir(doc);
  300
+
  301
+        doc = doc.documents[0];
  302
+        payload = doc.payload;
  303
+
  304
+        console.log("============================== payload mongodb")
  305
+        console.log(payload)
  306
+
  307
+        var payload = kerberos.decryptMessage(payload);
  308
+
  309
+        console.log("============================== payload decrypt")
  310
+        console.log(payload)
  311
+
  312
+        console.dir(kerberos.queryContextAttribute(0x00));
  313
+
  314
+        // payload = kerberos.encryptMessage(payload, username);
  315
+
  316
+        console.log("============================== payload encrypt")
  317
+        console.log(payload)
  318
+
  319
+        // var payload = kerberos.prepareOutboundPackage(target, payload);
  320
+
  321
+        // console.log("============================== payload sspi")
  322
+        // console.log(payload)
  323
+
  324
+        // // console.log("========= authenticate 5");
  325
+        // // console.log(payload)
  326
+
  327
+        // var command = {
  328
+        //     saslContinue: 1
  329
+        //   , conversationId: doc.conversationId
  330
+        //   , payload: payload
  331
+        // };
  332
+
  333
+        // db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  334
+        //   console.log("============================== payload mongodb")
  335
+        //   console.log(payload)
  336
+
  337
+        //   // console.log("========= authenticate 6");
  338
+        //   // console.dir(err);
  339
+        //   // console.dir(doc);
  340
+        // });
  341
+      });
  342
+    });
  343
+  });
  344
+
  345
+
  346
+  //
  347
+  // TODO: Authenticate all connections with the credentials
  348
+  // TODO: Ensure correct Re-Authentication of all connections on reconnects using GSSAPI
  349
+  //
  350
+  // var connections = db.serverConfig.allRawConnections();
  351
+  // var error = null;
  352
+  // // Authenticate all connections
  353
+  // for(var i = 0; i < numberOfConnections; i++) {
  354
+
  355
+    // // Start Auth process for a connection
  356
+    // GSSAPIInitialize(db, username, password, authdb, connections[i], function(err, result) {
  357
+    //   // Adjust number of connections left to connect
  358
+    //   numberOfConnections = numberOfConnections - 1;
  359
+    //   // If we have an error save it
  360
+    //   if(err) error = err;
  361
+
  362
+    //   // We are done
  363
+    //   if(numberOfConnections == 0) {
  364
+    //     if(err) return callback(err, false);
  365
+    //     // We authenticated correctly save the credentials
  366
+    //     db.auths = [{'username':username, 'password':password, 'authdb': authdb, 'authMechanism': 'GSSAPI'}];
  367
+    //     // Return valid callback
  368
+    //     return callback(null, true);
  369
+    //   }
  370
+    // });    
  371
+  // }
  372
+}
  373
+
  374
+// //
  375
+// // Initialize step
  376
+// var GSSAPIInitialize = function(db, username, password, authdb, connection, callback) {
  377
+//   // Create Kerberos instance
  378
+//   var kerberos = new Kerberos();
  379
+//   // Right let's get sasl going
  380
+//   var connection = db.serverConfig.checkoutWriter();
  381
+//   // Create connection string
  382
+//   var kerberos_connection_string = format("mongodb@%s", db.serverConfig.host);
  383
+//   // Start the kerberos process
  384
+//   kerberos.authGSSClientInit(kerberos_connection_string, Kerberos.GSS_C_MUTUAL_FLAG, function(err, context) {
  385
+//     if(err) return callback(err, false);
  386
+
  387
+//     // Let's perform the first step
  388
+//     kerberos.authGSSClientStep(context, '', function(err, result) {
  389
+//       if(err) return callback(err, false);
  390
+//       // Call next step
  391
+//       MongoDBGSSAPIFirstStep(kerberos, context, db, username, password, authdb, connection, callback);
  392
+//     });
  393
+//   });
  394
+// }
  395
+
  396
+// //
  397
+// // Perform first step against mongodb
  398
+// var MongoDBGSSAPIFirstStep = function(kerberos, context, db, username, password, authdb, connection, callback) {
  399
+//   // Grab the payload
  400
+//   var payload = context.response;
  401
+//   // Build the sasl start command
  402
+//   var command = {
  403
+//       saslStart: 1
  404
+//     , mechanism: 'GSSAPI'
  405
+//     , payload: payload
  406
+//     , autoAuthorize: 1
  407
+//   };
  408
+
  409
+//   // Execute first sasl step
  410
+//   db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  411
+//     if(err) return callback(err, false);
  412
+//     // Get the payload
  413
+//     doc = doc.documents[0];
  414
+//     var db_payload = doc.payload;
  415
+    
  416
+//     // Show payload
  417
+//     kerberos.authGSSClientStep(context,  doc.payload, function(err, result) {
  418
+//       if(err) return callback(err, false);
  419
+//       // MongoDB API Second Step
  420
+//       MongoDBGSSAPISecondStep(kerberos, context, doc, db, username, password, authdb, connection, callback);
  421
+//     });
  422
+//   });
  423
+// }
  424
+
  425
+// //
  426
+// // Perform first step against mongodb
  427
+// var MongoDBGSSAPISecondStep = function(kerberos, context, doc, db, username, password, authdb, connection, callback) {
  428
+//   // Get the payload
  429
+//   var payload = context.response || '';
  430
+
  431
+//   // Build Authentication command to send to MongoDB
  432
+//   var command = {
  433
+//       saslContinue: 1
  434
+//     , conversationId: doc.conversationId
  435
+//     , payload: payload
  436
+//   };
  437
+
  438
+//   // Execute the command
  439
+//   db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  440
+//     if(err) return callback(err, false);
  441
+
  442
+//     // Get the result document
  443
+//     doc = doc.documents[0];
  444
+    
  445
+//     // GSS Client Unwrap
  446
+//     kerberos.authGSSClientUnwrap(context, doc.payload, function(err, result) {
  447
+//       if(err) return callback(err, false);
  448
+
  449
+//       var payload = context.response;
  450
+//       // Wrap the response
  451
+//       kerberos.authGSSClientWrap(context, payload, username, function(err, result) {
  452
+//         if(err) return callback(err, false);
  453
+
  454
+//         // Call the last and third step
  455
+//         MongoDBGSSAPIThirdStep(kerberos, context, doc, db, username, password, authdb, connection, callback);
  456
+//       });
  457
+//     });
  458
+//   });
  459
+// }
  460
+
  461
+// var MongoDBGSSAPIThirdStep = function(kerberos, context, doc, db, username, password, authdb, connection, callback) {
  462
+//   var payload = context.response;
  463
+
  464
+//   // Build final command
  465
+//   var command = {
  466
+//       saslContinue: 1
  467
+//     , conversationId: doc.conversationId
  468
+//     , payload: payload
  469
+//   };
  470
+
  471
+//   // Let's finish the auth process against mongodb
  472
+//   db._executeQueryCommand(DbCommand.createDbCommand(db, command, {}, '$external'), {connection:connection}, function(err, doc) {
  473
+//     if(err) return callback(err, false);
  474
+
  475
+//     // Clean up context
  476
+//     kerberos.authGSSClientClean(context, function(err, result) {
  477
+//       if(err) return callback(err, false);
  478
+//       callback(null, true);
  479
+//     });
  480
+//   });
  481
+// }
  482
+
  483
+exports.authenticate = authenticate;
21  lib/mongodb/db.js
@@ -18,14 +18,17 @@ var QueryCommand = require('./commands/query_command').QueryCommand
18 18
   , timers = require('timers')
19 19
   , utils = require('./utils')
20 20
   , mongodb_cr_authenticate = require('./auth/mongodb_cr.js').authenticate
21  
-  , mongodb_gssapi_authenticate = require('./auth/mongodb_gssapi.js').authenticate;
  21
+  , mongodb_gssapi_authenticate = require('./auth/mongodb_gssapi.js').authenticate
  22
+  , mongodb_sspi_authenticate = require('./auth/mongodb_sspi.js').authenticate;
22 23
 
23 24
 var hasKerberos = false;
24 25
 // Check if we have a the kerberos library
25 26
 try {
26  
-  require('Kerberos');
  27
+  require('kerberos');
27 28
   hasKerberos = true;
28  
-} catch(err) {}
  29
+} catch(err) {
  30
+  console.dir(err)
  31
+}
29 32
 
30 33
 // Set processor, setImmediate if 0.10 otherwise nextTick
31 34
 var processor = timers.setImmediate ? timers.setImmediate : process.nextTick;
@@ -668,10 +671,9 @@ Db.prototype.authenticate = function(username, password, options, callback) {
668 671
   if(options.authMechanism == 'MONGODB-CR') {
669 672
     mongodb_cr_authenticate(self, username, password, authdb, options, callback);
670 673
   } else if(options.authMechanism == 'GSSAPI') {
671  
-    
672 674
     //
673 675
     // Kerberos library is not installed, throw and error
674  
-    if(!hasKerberos) {
  676
+    if(hasKerberos == false) {
675 677
       console.log("========================================================================================");
676 678
       console.log("=  Please make sure that you install the Kerberos library to use GSSAPI                =");
677 679
       console.log("=                                                                                      =");
@@ -683,8 +685,13 @@ Db.prototype.authenticate = function(username, password, options, callback) {
683 685
       throw new Error("Kerberos library not installed");
684 686
     }
685 687
 
686  
-    // We have the kerberos library, execute auth process
687  
-    mongodb_gssapi_authenticate(self, username, password, authdb, options, callback);
  688
+
  689
+    if(process.platform == 'win32') {
  690
+      mongodb_sspi_authenticate(self, username, password, authdb, options, callback);
  691
+    } else {
  692
+      // We have the kerberos library, execute auth process
  693
+      mongodb_gssapi_authenticate(self, username, password, authdb, options, callback);      
  694
+    }
688 695
   }
689 696
 };
690 697
 
19  test/configurations/none.js
@@ -23,25 +23,6 @@ var none = function(options) {
23 23
     callback();
24 24
   };
25 25
 
26  
-  // var mapFunction = function(replicasetManager, name) {
27  
-  //   return function() {
28  
-  //     var args = Array.prototype.slice.call(arguments, 0);
29  
-  //     replicasetManager[name].apply(replicasetManager, args);        
30  
-  //   }
31  
-  // }
32  
-
33  
-  // this.killPrimary = mapFunction(replicasetManager, 'killPrimary');
34  
-  // this.restartKilledNodes = mapFunction(replicasetManager, 'restartKilledNodes');
35  
-  // this.stepDownPrimary = mapFunction(replicasetManager, 'stepDownPrimary');
36  
-  // this.getNodeFromPort = mapFunction(replicasetManager, 'getNodeFromPort');
37  
-  // this.kill = mapFunction(replicasetManager, 'kill');
38  
-  // this.killSecondary = mapFunction(replicasetManager, 'killSecondary');
39  
-  // this.primary = mapFunction(replicasetManager, 'primary');
40  
-  // this.secondaries = mapFunction(replicasetManager, 'secondaries');
41  
-  // this.arbiters = mapFunction(replicasetManager, 'arbiters');    
42  
-  // this.setAuths = mapFunction(replicasetManager, 'setAuths');
43  
-  // this.stepDownPrimary = mapFunction(replicasetManager, 'stepDownPrimary');
44  
-
45 26
   // Pr test functions
46 27
   this.setup = function(callback) { 
47 28
     callback(); 
BIN  test/tests/kerberos/10gen.me.reg
Binary file not shown
4  test/tests/kerberos/kdc_tests.js
@@ -12,13 +12,15 @@ exports['Should Correctly Authenticate using kerberos with MongoClient'] = funct
12 12
     , MongoClient = configuration.getMongoPackage().MongoClient
13 13
     , Server = configuration.getMongoPackage().Server;
14 14
 
  15
+    console.log("============= hey")
  16
+
15 17
   // KDC Server
16 18
   var server = "kdc.10gen.me";
17 19
   var principal = "dev1@10GEN.ME";
18 20
   var urlEncodedPrincipal = encodeURIComponent(principal);
19 21
 
20 22
   // Let's write the actual connection code
21  
-  MongoClient.connect(format("mongodb://%s@%s/test?authMechanism=GSSAPI&maxPoolSize=5", urlEncodedPrincipal, server), function(err, db) {
  23
+  MongoClient.connect(format("mongodb://%s@%s/test?authMechanism=GSSAPI&maxPoolSize=1", urlEncodedPrincipal, server), function(err, db) {
22 24
     test.equal(null, err);
23 25
     test.ok(db != null);
24 26
 

0 notes on commit f5af480

Please sign in to comment.
Something went wrong with that request. Please try again.