➜ mytodos git:(master ) npm install ldapauth
[email protected] install /home/raphael/dev/mytodos/node_modules/ldapauth/node_modules/bcrypt
node-gyp rebuild
make: Entering directory '/home/raphael/dev/mytodos/node_modules/ldapauth/node_modules/bcrypt/build'
CXX (target ) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX (target ) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX (target ) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
../src/bcrypt_node.cc: In destructor ‘ virtual {anonymous}::baton_base::~baton_base ()’:
../src/bcrypt_node.cc:118:18: error: ‘ class v8::Persistent<v8::Function>’ has no member named ‘ Dispose ’
callback.Dispose ();
^
../src/bcrypt_node.cc: At global scope:
../src/bcrypt_node.cc:198:19: error: variable or field ‘ GenSaltAsync ’ declared void
void GenSaltAsync (uv_work_t* req ) {
^
../src/bcrypt_node.cc:198:19: error: ‘ uv_work_t ’ was not declared in this scope
../src/bcrypt_node.cc:198:30: error: ‘ req ’ was not declared in this scope
void GenSaltAsync (uv_work_t* req ) {
^
../src/bcrypt_node.cc:483:30: error: expected ‘}’ at end of input
NODE_MODULE (bcrypt_lib, init );
^
../src/bcrypt_node.cc:85:13: warning: ‘ void crypto_lock_init ()’ defined but not used [-Wunused-function]
static void crypto_lock_init (void ) {
^
../src/bcrypt_node.cc:95:13: warning: ‘ void crypto_lock_cb (int, int, const char, int )’ defined but not used [-Wunused-function]
static void crypto_lock_cb (int mode, int n, const char file, int line ) {
^
../src/bcrypt_node.cc:105:22: warning: ‘ long unsigned int crypto_id_cb ()’ defined but not used [-Wunused-function]
static unsigned long crypto_id_cb (void ) {
^
../src/bcrypt_node.cc:140:5: warning: ‘ int {anonymous}::GetSeed (uint8_t, int )’ defined but not used [-Wunused-function]
int GetSeed (uint8_t seed, int size ) {
^
../src/bcrypt_node.cc:150:6: warning: ‘ bool {anonymous}::ValidateSalt (const char)’ defined but not used [-Wunused-function]
bool ValidateSalt (const char salt ) {
^
bcrypt_lib.target.mk:88: recipe for target 'Release/obj.target/bcrypt_lib/src/bcrypt_node.o' failed
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
make: Leaving directory '/home/raphael/dev/mytodos/node_modules/ldapauth/node_modules/bcrypt/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/raphael/.nvm/versions/node/v0.12.4/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23 )
gyp ERR! stack at ChildProcess.emit (events.js:110:17 )
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12 )
gyp ERR! System Linux 3.19.0-15-generic
gyp ERR! command "node" "/home/raphael/.nvm/versions/node/v0.12.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/raphael/dev/mytodos/node_modules/ldapauth/node_modules/bcrypt
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
1
jarlyyn 2015-09-08 17:33:04 +08:00
|
2
jarlyyn 2015-09-08 17:33:45 +08:00
User.prototype.getLdapClient=function ()
{ var web=this.web; return ldap.createClient (web.settings.ldap ); } User.prototype.auth=function (uid,password,callback ) { var User=this; this.getLdapClient ().bind ('uid='+uid+',ou=People,dc=xxxx',password,function (err ){ if (err ){return callback (err,null )} User.find (uid,function (err,result ){ if (err ){return callback (err,null )} callback (null,result ); }); }); } 大概是这样的。 |
4
scarlex 2015-09-08 18:28:39 +08:00
目测是 bcrypt 的问题, 0.7.5 只能用 Node 0.10.x
楼主的 Node 是 0.12 吧,降到 0.10 试试 |
6
nuc093 OP |
7
nuc093 OP var ldap = require ('ldapjs');
var client = ldap.createClient ({ url: 'ldap://192.168.96.23:389' }); client.bind ('cn=admin,dc=ds,dc=com', 'linux', function (err ) { assert.ifError (err ); }); |