veo-labs / ldap-server-mock

Really simple basic mock for LDAP server
GNU Affero General Public License v3.0
67 stars 26 forks source link

Error: Invalid arguments: /data/ldap-server-mock-conf.json: Unexpected token / in JSON at position 18 #7

Open unclesamwk opened 4 years ago

unclesamwk commented 4 years ago

Hey i get this error when i will start ldap-server ...

node node_modules/ldap-server-mock/server.js --conf=/data/ldap-server-mock-conf.json --database=/data/users.json
/data/node_modules/ldap-server-mock/server.js:23
  throw new Error(`Invalid arguments: ${error.message}`);
  ^

Error: Invalid arguments: /data/ldap-server-mock-conf.json: Unexpected token / in JSON at position 18
    at Object.<anonymous> (/data/node_modules/ldap-server-mock/server.js:23:9)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)

you have any idea why?

greetings sam

maxime-beguin commented 4 years ago

Hi,

Your ldap-server-mock-conf.json file seems to be an invalid JSON file.

unclesamwk commented 4 years ago

thank you, i copy and paste your examples ...i must delete the comments, the it works.

Can please post an full example where i can test an ldapsearch? ldapsearch -D "cn=sam" -w "password" -p 389 -h 10.100.0.3 -b "dc=example,dc=com"

error:
ldap_bind: No such object (32)
    additional info: No tree found for: cn=sam
unclesamwk commented 4 years ago

this works ...

ldapsearch -D "cn=sam,dc=example,dc=com" -p 389 -h 10.100.0.3
# extended LDIF
#
# LDAPv3
# base <> (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 32 No such object
text: No tree found for: 

# numResponses: 1

But without password ...