When working with Windows Active Directory and your users are logging in Sitefinity CMS via LDAP, you may add custom LDAP fields to the LDAP profiles. However, Sitefinity CMS user profiles are not automatically created for LDAP users. User profiles are only created when you edit or re-save the LDAP user in the backend in the Administration » Users screen. You set the default properties for the user but do not map any custom fieldsof the LDAP user profile to the Sitefinity CMS user profile.
To map custom fields of both types of profiles and create and update the user profile for the LDAP user, you leverage the Sitefinity CMS API.
You have a Sitefinity CMS Administrator role.
For more information, see Overview: Roles.
You created the required number of custom fields in the specific profile type.
For more information, see Edit the fields of a profile type.
Once you add the required number and type of custom fields to the user profile types, you map them to the LDAP fields. To do so:
Navigate to Administration » Settings » Advanced » Security » LDAP Settings » LDAP Mapping » LDAP Types Mapping » UserMapping » LDAP Properties Mapping.
2. Click Create new button.
3. In the PropertyName field, enter the name of the custom profile field created in Sitefinity CMS user profile.
4. In LdapField field enter the LDAP field name.
5. Save your changes.
Once an LDAP user logs in Sitefinity CMS, you want to set all the LDAP properties in the user profile. To do this, you attach to the ILoginCompletedEvent in the Global.asax file, so that the user profile is matched to the LDAP user.
Next, in the LoginCompletedEventVerification , follow these steps:
NOTE: You can implement other field types, as well.
The LoginCompletedEventVerification event handler is executed every time a user logs in Sitefinity CMS. A Sitefinity CS user profile is created for the LDAP user and the mapped LDAP fields are set to the profile fields using the API.
Back To Top