Sharepoint 2013, FBA shows Exception, User does not exist, User not found

226 Views Asked by At

Environment : SharePoint 2013 , FBA implementation, SQL server 2012.

Issue Definition : it is not allowing us to add same user name existing in resembling name of organization as shown below. it shows an exception at 2 places.

Robert.Green robert.green@ABC -> Successful

Robert.Green robert.green@ABC Codes Service -> FAIL – Exception, User does not exist, User not found

Below is code for adding users.

spWeb.SiteUsers.Add("i:0#.f|providername|robert.green@Codes Service", user.Email, user.UserName, string.Empty); - Exception : User does not exist

sharepointUser = spWeb.SiteUsers["i:0#.f|providername|robert.green@Codes Service"];

Exception : User not found

1

There are 1 best solutions below

0
Maarten On

Domain is invalid for that second user. Spaces aren't valid in that context. Replace spaces with dashes or underscores or something to avoid the issue.