This plugin allows users to be enrolled according to a value stored in their user profile fields. If you use an external authentication method (LDAP, Shibboleth), you can store values in hidden user fields of the users' Moodle profile, and then use these values to automatically enrol users if some courses.