One thing immediately becames visible is the user name. When you log with Active Directory you see a friendly name like shown below.
However , with the form authentication you see the loginId and NOT the FirstName & Last Name, you would like to see.The reason is simple. The standard MembershipUser interface, only has one property called "UserName", This properly holds the fully qualified user name ( domain/username) or (membershipprovider/userId) .
So how do we display a friendly name? After investigating, I came up with two options.
1) User Profile (MOSS Only)
It appears that SharePoint read the friendly display name from the user profile of a user if one exists. By default there is no user profile created for FBA. You can manually create a user profile for all users via SSP or programmatically create for all users.
I found following utility by Sahil , which takes a xml file and does bulk user profile import. Sahils' also shows a code snippet on how to programmatically create user profile
http://blah.winsmarts.com/2007-1-SharePoint_2007_Utility_-2_-_PI_-_Utility_to_Import-Export_actual_user_profiles.aspx
http://blah.winsmarts.com/2007-1-SharePoint_2007_Utility_-2_-_PI_-_Utility_to_Import-Export_actual_user_profiles.aspx
2) UserInfo table (WSS and MOSS)
This solution requires direct update to SharePoint table but does work. So I recommend carefully planning before any update.
At every site collection level, SharePoint stores the firstname + last name in the userInfo table . The friendly name is appears to be picked up from the tp_title column. I believe SharePoint creates entry in this table, the first time you add a user in any list or a site ACL. Look for your form authenticatation (FBA) userId in this table and replace it with a friendly name.
At every site collection level, SharePoint stores the firstname + last name in the userInfo table . The friendly name is appears to be picked up from the tp_title column. I believe SharePoint creates entry in this table, the first time you add a user in any list or a site ACL. Look for your form authenticatation (FBA) userId in this table and replace it with a friendly name.
I think this is a good enhancement request for MembershipProvider and SharePoint team
6 comments:
Super !! It helped me a lot.
I'm trying to implement Search Server Express with Forms Based Authentication, however when searching file shares and using FBA i do not get any results, when using Windows and searching i get results checking the indexing status shows that it did index files, i am assuming that since MSSX limits results based on the files ACL on disk that that information is not carried over when i use FBA? Any suggestions??
I think most people would recommend against modifying the SharePoint DB directly, and I personally didn't like having to run a batch job to keep things in sync.
Stumbled on this other post, which has a great idea, which led me to the final solution (using the SP web services' UserGroup.UpdateUserInfo method).
http://stackoverflow.com/questions/1898756/fba-display-name-with-custom-membership-provider-wss-3-0/
My current project requires ability to display choice column value via color or image associated with a choice
But Sharepoint standard packaged misses that control
I am looking for available solutions on market
I came across
http://amazepoint.com/Products/VisualChoiceColumn/Overview.aspx>
Does anybody has experiece using it?
Post a Comment