etyp / meteor-accounts-ldap

A Meteor package for logging in and creating users with LDAP credentials
MIT License
39 stars 23 forks source link

How to add profile information in collection Meteor.users #17

Closed Sandeep3005 closed 8 years ago

Sandeep3005 commented 8 years ago

Hi

I have included accounts-password package and new user got created in Meteor.users() Collection.

So I think LDAP Authentication is achieved . Ploblem solved :smile:

Thanks for all your hard work.

One more query

New document in Meteor.users only contain username --- how to insert a profile (email, age etc) when new user created If any idea

Thanks again

etyp commented 8 years ago

Hi! Glad you got it working. You can have the email, age, etc. set by adding them to the profile map:

LDAP_DEFAULTS.searchResultsProfileMap = [{
  resultKey: 'cn',
  profileProperty: 'name'
}, {
  resultKey: 'ag', // This would be whatever the ldap key for 'age' actually is.
  profileProperty: 'age'
}], // Etc.

It depends on what the named properties are in your LDAP setup, but the profile map will map those properties back to the user.profile object for you.