LDAP user first name and last name not getting in the database

32 views
Skip to first unread message

Oasis Agano

unread,
Apr 28, 2018, 1:50:01 PM4/28/18
to web2py-users
Greetings,

I have setup an LDAP connection that works,
the user can sign in but the issue is after signing in the first_name and last_name and email arent stored in the system.

The first name is set to the current username but the other fields(last name and email) arent set.

this is my code:

auth.settings.login_methods.append(ldap_auth(mode='ad',
                                        manage_groups= True,
                                        db = db,
                                        server='ip',port=389,
                                        user_firstname_attrib = 'givenName',
                                        user_lastname_attrib = 'sn',
                                        user_mail_attrib = 'mail',
                                        base_dn='dc=myserver,dc=local'))

I also tried this

auth.settings.login_methods.append(ldap_auth(mode='ad',
                                        manage_groups= True,
                                        db = db,
                                        server='ip',port=389,
                                        user_firstname_attrib = 'cn:1',
                                        user_lastname_attrib = 'cn2',
                                        user_mail_attrib = 'mail',
                                        base_dn='dc=myserver,dc=local'))

but still the same result.

Any help is welcome.

Thanks

Gaurav Shet

unread,
May 4, 2018, 11:19:28 AM5/4/18
to web...@googlegroups.com
Even I am facing the same issue. Were you able to resolve this? 

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
Thanks & Regards
Gaurav Shet

Oasis Agano

unread,
May 4, 2018, 11:27:01 AM5/4/18
to web2py-users
Yes i solved it by just doing this:

auth.settings.login_methods.append(ldap_auth(mode='ad',
manage_groups= True,
                                        manage_user=True,

db = db,
server='ip',port=389,
user_firstname_attrib = 'givenName',
user_lastname_attrib = 'sn',
user_mail_attrib = 'mail',
                                        base_dn='dc=server,dc=local'))

Added the manage_user = True

Reply all
Reply to author
Forward
0 new messages