Define custom claim mapping for SharePoint server-based integration
Applies To: Dynamics CRM 2015
For server-based integration with SharePoint, Microsoft Dynamics CRM Online uses claims to authenticate and authorize CRM users to access the documents stored in SharePoint. For more information about claims-based authentication, see Claims-based identity in SharePoint 2013.
By default, CRM Online uses the following claim mappings to integrate with SharePoint:
SharePoint Online: NameId (PUID)
SharePoint on-premises: SMTP (email)
You can use the UserMapping entity to specify custom claim mappings in CRM to use a value other than the default value used by CRM Online to authenticate and authorize CRM users in SharePoint. For example, you can choose to use the “last name” and “first name” of the user instead of “email” to authenticate CRM users in SharePoint. Custom claim mappings are generally used for integrating with SharePoint on-premises. Custom claim mappings override the default claim mappings used by CRM. You can define multiple custom claim mappings in CRM. By default, only users having the System Administrator role have access to the UserMapping entity.
Note
For Microsoft Dynamics CRM Online organizations, this feature is available only if your organization has updated to Dynamics CRM Online 2015 Update 1. This feature is not available for Dynamics CRM (on-premises).
To define a custom claim mapping in CRM, create a UserMapping entity record, and specify the attribute values listed in the following table.
Attribute |
Value |
Description |
---|---|---|
UserMapping.PartnerApplicationType |
|
The partner application type for which this claim mapping is to be used. In the current release, only 0 (SharePoint) is supported. |
UserMapping.SystemUserAttributeName |
String value |
The logical name of the attribute in the SystemUser (user) entity from where the value for the claims will be used. Note If the attribute used for custom claim mapping doesn’t contain a value, the default claim mapping is used by CRM. For example, if you choose to use the first name of the user as the attribute for custom claim mapping and a user’s first name is missing, CRM will use the default claim mapping (PUID or email). |
UserMapping.ClaimType |
String value |
Specify the claim type to be sent to SharePoint. For a list of claim types, see ClaimTypes Members. Note The referred claim type list is just for reference. All the claim types listed there might not be supported by SharePoint, or might not contain all the claim types supported by SharePoint. |
The following sample code shows how to define a custom claim mapping using the UserMapping entity.
UserMapping customMapping = new UserMapping
{
PartnerApplicationType = new OptionSetValue(0),
SystemUserAttributeName = "personalemailaddress",
ClaimType = "smtp"
};
_serviceProxy.Create(customMapping);
Note
Any instance of the UserMapping entity with valid values will override the default claim mappings used by CRM Online.
By default, SharePoint supports the following claim types: NameId (PUID), SMTP (email), and UPN (user principal name). If you’re passing claim of any other type than the ones supported by default by SharePoint, you must also create corresponding claim type mappings in SharePoint. More information: New-SPClaimTypeMapping
See Also
UserMapping entity messages and methods
Integrate Microsoft Dynamics CRM with SharePoint
© 2016 Microsoft. All rights reserved. Copyright