LDAP Role Mapping

LDAP Role Mapping

by Matt Lockey -
Number of replies: 6

Hi,

I have users accounts in Active Directory with Moodle configured to use LDAP authentication and single sign on. This works great, but when users log in to Moodle they are not given any roles, so I want to use LDAP Role Mapping to assign students to the site-wide Student Role. Students are in their own OU in Active Directory and also have a AD attribute which identifies them as being a student. How on earth do I configure LDAP Role Mapping!?

Any and all help would be appreciated.

Average of ratings: -
In reply to Matt Lockey

Re: LDAP Role Mapping

by Andrea Bicciolo -
Hi Matt,

assigning users the role of student at site level, i.e. upon authenticating, it is probably something you would avoid as those users will inherit the student role on every course of your site. Upon authentication users are normally assigned the "Authenticated user" role, and roles such as student and teacher are assigned on course contexts.

For an assign roles overview: http://docs.moodle.org/26/en/Assign_roles

If you want to map AD/LDAP roles in a course, you may want to check LDAP enrollment plugin. That plugin allows you to enroll users in courses and map to users the role yos want according to defined LDAP contexts structure: http://docs.moodle.org/26/en/LDAP_enrolment
In reply to Andrea Bicciolo

Re: LDAP Role Mapping

by Chris Chapman -

This is all well and good Andrea, However I believe Matt (and myself) have created our own (system wide) roles for students, or in my case staff. What would be good is if we can map LDAP to identify a user field or OU and assign them the relevant system role not course specific at all.

In my case I want to assign all staff a role I have created which gives them read access to all courses , students I'm still working on a solution!

 

any ideas?

 

Many thanks

In reply to Chris Chapman

Re: LDAP Role Mapping

by Catherine Pinnell -

Hi Chris,

Did you by chance figure this out? I have been searching on how to assign roles with LADP authentication and have not found a solution yet. 

What we have done so far is to successfully create and disable users through LDAP and create cohorts through Active Directory Groups. Both of these are essential, but I am still missing the role piece of the puzzle.

Anyone with insights on how to automatically assign roles through LDAP or any other automated process? Any tips would be very appreciated!

Thanks, Catherine

In reply to Catherine Pinnell

Re: LDAP Role Mapping

by Jinxing Chen -

Hi, all

I have same problem here, the user is using LDAP to login.

Under LDAP enrollment, i have setup the context to custom role, the role context is same as auth context.

I assuming the should auto assign the role when user logined.

Am I right?

In reply to Jinxing Chen

Re: LDAP Role Mapping

by Catherine Pinnell -

I wanted to add a reference to this plug-in to this thread too:

https://moodle.org/plugins/view.php?plugin=local_cohortrole

So, if you are using LADP to create your users, you can also create user groups from your active directory. Those groups can create cohorts in your moodle site. If you also need a group of users to be assigned a role, the  plugin above should assist with that part of the task. 

Disclaimer: I have not used this plug-in, but have been scouring the forums for so long that I thought it would be important to share this discovery. I hope it works!

In reply to Andrea Bicciolo

Re: LDAP Role Mapping

by Mariam SABIL -

Hi Andrea, 

I'm using LDAP authentication and it works good, now I want to assign the student role to a group of people who have a special context in LDAP which means that when the user is authenticated he is automatically a student on every course in the site.

I found LDAP enrolment but I can't work with it since I dont have groups for courses in my LDAP tree, I searched again and found this plugin "user role assignment from ldap" (https://moodle.org/plugins/enrol_ldapuserrel) but I'm not sure that it is compatible with my version of moodle (3.0).

I will be grateful if you have other ideas that can help,

Thank you smile