Friday, December 10, 2010

Configuring Custom User Profiles Properly

When it comes to custom user profiles, Sitecore is very flexible but sometimes that comes at a price. The description of setting up custom user profiles is straight forward in the documentation and as long as you only wish to access the properties in code it works great, however if you wish to access the properties from the database level you will need to add a few extra entries to the web.config.

STEP 1: Set up the Custom User Profile as documented in the Sitecore Security API Cookbook available on the Sitecore Developer Network

STEP 2: Make note of the custom properties you created and open the web.config. Search for "SC_UserData" Add items similar to this item below the existing SC_UserData item. Change the data type and field name to match the fields you added.

STEP 3: Read the following article to see how to get the aspnet profile properties from SQL Server

STEP 4: Create your user in the admin once created edit the user and click change to set your custom profile. Add data to the fields and check if its appearing for in SQL

STEP 5: When you create a user in code you will have to add the custom profile to them. as documented in the Sitecore Security API Cookbook available on the Sitecore Developer Network

If you found this article useful be sure to pass it on. If you have any tips, tricks or resources you would like to share with the Guild please email them to sitecoreguild@outlook.com

No comments:

Post a Comment