Use openLDAP with meteor JS
<p>I need to implement LDAP authentication for a Meteor App, and as we do not have LDAP server currently present.</p>

<p>Can I use OpenLDAP for implementation on my local machine.</p>

<p>I do not know a lot about LDAP authentication.. So I can appreciate any help I can get.. I am implementing this below mentioned piece of code which my friend has provided</p>

<pre><code>        Template.ldapLogin.events({
        'submit #login-form': function (e) {
            e.preventDefault();
            var form = $(e.target);
            var username = form.find("#login-form-username").val();
            var password = form.find("#login-form-password").val();

            if (username === "admin") {
            Meteor.loginWithPassword(username, password, function (error) {
                if ( ! error &amp;&amp; password === "admin") {
                // Set switch to trigger alert to change password
                Session.setPersistent("passChangePrompt", 1);
                }
            });
            } else {
            Meteor.loginWithLDAP(username, password,
                { dn: "uid=" + username + ",ou=&lt;foo&gt;,dc=&lt;bar&gt;,dc=&lt;baz&gt;,dc=&lt;qux&gt;" },
                function (error, success) {
                if (error) {
                    console.log(error.reason);
                } else {
                    FlowRouter.redirect('/');
                };
            });
            }
        }
        });
        Server:

        Meteor.startup( function() {
        LDAP_DEFAULTS.url = 'ldap://&lt;ask your IT dude or gal&gt;';
        LDAP_DEFAULTS.dn = 'ou=&lt;foo&gt;,dc=&lt;bar&gt;,dc=&lt;baz&gt;,dc=&lt;qux&gt;';
        LDAP_DEFAULTS.port = '';
        LDAP_DEFAULTS.searchResultsProfileMap = [
            {
            resultKey: 'cn',
            profileProperty: 'name'
            }
            ,{
            resultKey: 'mail',
            profileProperty: 'phoneNumber'
            }
        ]
        });
</code></pre>

<p>Thanks again</p>