AnsweredAssumed Answered

Password errors when logging in with REST and LDAP

Question asked by Hong Hong on Jun 16, 2014
Hi, I am having trouble to login a ldap user via REST-API. I follow the code example in the documentation (
but instead of PHP I use Javascript. I can already login as a normal user via REST-API.
Here is my javascript code:
// password generation for ldap user
var ldap_key = "secret";
ldap_key = md5(ldap_key).substr(0,24);
var pw = CryptoJS.TripleDES.encrypt(password, ldap_key,{mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.ZeroPadding});

// pw.toString return hex value in this case:
password = pw.toString();

// defining payload
var params = {
               application: "test client"
var json = JSON.stringify(params);

   url: "https://someurl",
   type: "POST",
   data: {
    method: "login",
    input_type: "JSON",
    response_type: "JSON",
    rest_data: json
   dataType: "json",
   success: function (result) {
    // do something here
Any ideas, what I did wrong?


Sorry, forgot to mention that I receive the message that login or password are incorrect when I use the code above.

Description was: "Login attempt failed please check the username and password".