1
votes

I'm currently migrating an enterprise content management system that was built on Sharepoint 2007 to Sharepoint 2010. The system contains a custom forms based authentication provider and a custom role provider. User-role mappings are stored in the DB like below:

userID roleID siteURL


21 15 www.sitea.com

21 10 www.siteb.com

22 15 www.sitea.com

In the role provider the role that the is assigned to in the current site is get and set through site URL. This was solved by setting a custom property (e.g. property named SiteURL) of the role provider in its Initilize method like the following:

SiteURL = SPContext.Current.Web.Url;

However, in Sharepoint 2010 that line could not be used anymore. Because in Sharepoint 2010 claims authorization, custom role provider is called in a seperate web service named SecurityToken web service. So SPContext.Current is null.

Now I have to find an alternate way to get the site url that is requesting authentication. Would you provide me any suggestions?

1

1 Answers

0
votes

Would it work to set up separate roles for each domain name?

Lets suppose you provided services to car dealerships, and each dealership had a separate domain name, and separate roles (i.e., users in the 'Manager' role for one dealership should not have the 'Manager' role for another dealership, because they are two separate companies with different management structures). You could have a Manager_HensonFord role for hensonford.com, and a Manager_CharlesFord role for charlesford.com.

It that doesn't work, can you give us a little more context on what this is used for?