Meteor Ldap Custom Login Method

624 views
Skip to first unread message

Eric Typaldos

unread,
Dec 8, 2014, 11:34:08 PM12/8/14
to meteo...@googlegroups.com
I'm trying to implement a custom login method that uses ldap. I'm using the ldapjs node module and am able to authenticate properly against it, but I'm having troubles getting my custom login handler to work.

Right now I have the following:

1.
Accounts.registerLoginHandler("ldap", function(loginRequest) {...});


Which basically does the same exact thing as the example from Meteor Hacks: https://meteorhacks.com/extending-meteor-accounts.html - only difference is my logic does an ldap check rather than his check for 'admin-password'.

2. 
Meteor.loginWithLdap = function(username, pw, callback) {
....
Accounts.callLoginMethod({
 methodArguments
: [loginReq],
 userCallback
: function (err, result) {
 
if (err)
 console
.log(err);
 
}
});

But when I try to call the Meteor.loginWithLdap method, I'm getting the following error (client side console):

Unrecognized options for login request [400]

Right now I just have accounts-base installed and adding users as hard coded seed data, so my users collection consists of about 10 users created like this:

 Meteor.users.insert({
 username
: rows[i].login,
 email
: email
 
});


I've read through accounts-base and accounts-password source code with no luck, so I was wondering if maybe I'm totally missing something. Thanks!

Avital Oliver

unread,
Dec 9, 2014, 2:30:13 AM12/9/14
to meteo...@googlegroups.com
From looking at where the code throws "Unrecognized options for login request", it looks like the arguments you're passing in `methodArguments` when calling `callLoginMethod` don't match the test you have within the function you passed to `Accounts.registerLoginHandler`. Maybe if you add logs inside that function you'll find some simple mistake.

--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meteor-talk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meteor-talk/4b562600-7124-4273-bfb1-e7617efb731d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages