Error: urlStr + ' is an invalid LDAP url (scope)'
See original GitHub issueHi, I am using this very simple code to connect to LDAP but no matter what i keep on getting the following error:
var ldap = require('ldapjs');
var client = ldap.createClient({url:'ldap://openam.sandbox.local:10389'});
client.bind('cn=DM', 'test', function(err) {
if (err){
console.log("not able to connect")
} else {
console.log("connected successfully")
}
});
I am using mac.
/Users/ashishjindal/Projects/sw-app-api/api-testing/node_modules/ldapjs/lib/url.js:15
throw new TypeError(urlStr + ' is an invalid LDAP url (scope)')
^
TypeError: ldap://openam.sandbox.local:10389 is an invalid LDAP url (scope)
at Object.parse (/Users/ashishjindal/Projects/sw-app-api/api-testing/node_modules/ldapjs/lib/url.js:15:13)
at new Client (/Users/ashishjindal/Projects/sw-app-api/api-testing/node_modules/ldapjs/lib/client/client.js:114:33)
at Object.createClient (/Users/ashishjindal/Projects/sw-app-api/api-testing/node_modules/ldapjs/lib/client/index.js:17:12)
at Object.<anonymous> (/Users/ashishjindal/Projects/sw-app-api/api-testing/tests/builders/ldap.js:3:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
[Done] exited with code=1 in 0.148 seconds
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Ldapjs can't connect with a server - Stack Overflow
js we need to do the following changes, after the changes it working fine. Error: parsedURL = new url.URL(urlStr). Solution: parsedURL = new ......
Read more >Error: urlStr + ' is an invalid LDAP url (scope)' - Bountysource
Hi, I am using this very simple code to connect to LDAP but no matter what i keep on getting the following error:...
Read more >LDAP URLs
An LDAP URL is a string that can be used to encapsulate the address and port of a directory server, the DN of...
Read more >LDAP client and server APIs - GitHub Pages
'sub') throw new TypeError(urlStr + ' is an invalid LDAP url (scope)'); u.scope = tmp[1]; } if (tmp[2]) { u.filter = querystring.unescape(tmp[2]); }...
Read more >APM Cookbook: Modify LDAP Attribute Values using iRulesLX
throw new TypeError(urlStr + ' is an invalid LDAP url (scope)'). } Note that although the error message says "(scope)", I do not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i got it working my changing url.URL to url.Parse parsedURL = new url.parse(urlStr) //parsedURL = new url.URL(urlStr) } catch (error) {
I’m using ldapjs 2.3.3 and node 18.12.0 but still encoutering the same error in ldap.createClient. I tried to console log url.parse and that works but url.URL seems to not. while parsing using URL hostname and port are null and everyting is getting added to pathname only.