UserGroup WebService with SharePoint 2013 Claims Authentication

 

Hey guys,

 

I'm experiencing some issues when working with the UserGroups WebService.

As many of you know SharePoint 2013 recommended to use Claims-Based authentication mechamism, so by default each SharePoint is using this authentication.

(Difference between Claims and Classic)

 

Each time you add a new user to a group please be aware to use the prefix for claims authentication for the loginName, otherwise SharePoint will add permission for the Windows User account.

And if classic mode is not configured for this site the user won't get access to the site.

 

Claims-Based Authentication (more infos):

UserGroupProxy.AddUserToGroup(role, displayName, "i:0#.w|" + loginName, email, description);

 

Windows Authentication:

m_UserGroup.AddUserToGroup(role, displayName, loginName, email, description);

 

Also if you receive users from a SharePoint site where Claims based authentication is active, the user object will look like the following:

SidNameLoginNameEmailNotesIsSiteAdminIsDomainGroupFlags

 

Admin i:0#.w|datest\admin Admin@daenet.test   True False 0


As you can see the SId is not filled, if you need to compare the SharePoint user with a NetworkIdentity you need to search the account by DisplayName, Email or LoginName (be aware to cut off the prefix)

 

greets

nadine


Posted Jun 14 2013, 11:20 AM by Nadine Storandt

Comments

ebesovv@gmail.com wrote re: UserGroup WebService with SharePoint 2013 Claims Authentication
on 08-10-2013 8:49

thanks for share!

developers.de is a .Net Community Blog powered by daenet GmbH.