RE: Sharing Users, but not roles between Applications



<!-- membership provider -->
<roleManager enabled="true" cacheRolesInCookie="true"
createPersistentCookie="true" >
<providers>
<remove name="DefaultRoleProvider" />
<add applicationName="/" connectionStringName="LocalSqlServer"
name="DefaultRoleProvider"
type="System.Web.Security.SqlRoleProvider" />
</providers>
</roleManager>

-- the provider name and type would be replaced with your custom provider
name and namespace/class names.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"Francis Reed" wrote:

Hi Peter

That's a great idea which will work very well in my situation. I decided to
derived from the SqlRoleProvider as shown below.

public class EconcordiaSqlRoleProvider : SqlRoleProvider
{
public EconcordiaSqlRoleProvider () : base()
{
}
}

I have a quick question concerning the SqlRoleProvider. Where is the
SqlConnection, ConnectionString, or ConnectionStringName stored in the
SqlRoleProvider instance? I want to use that connection for my custom methods
which accept the applicationID. If you can help me out or give any advice, I
would really appreciate it.

Cheers
Francis

"Peter Bromberg [C# MVP]" wrote:

Aside from the fact that it's usually not a good idea to mix Chemistry with
Religion anyway, probably the cleanest was to handle this is to override the
SqlRoleProvider class with custom methods that accept an applicationID, and
pass this concept through to the stored procedures, which can be easily
modified.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
.



Relevant Pages

  • RE: WebPart Personalization Blob Deserialize Error
    ... you're writing your custom code to load binary data ... personalization provider or customize the existing one will you need to ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Problem implimenting a Custom Active Directory Role Provider
    ... worker process in debug menu (use IISAPP from prompt to sort out what ... AD and users in custom database, ... administration so that you can add custom provider member/roles to the ... accessible through Forms Authentication and cannot use Windows Authentication ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: using custom database for membership and rolls ?
    ... if you have a custom database...and you've written a custom membership ... provider, you don't need any setup tool. ... This is how to use Access (Jet database) for membership. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Extending MembershipUser
    ... So is there any particular custom types used in your membership provider ... make them in a separate class library project (include ... | succeeds (i.e., instances of my custom MembershipUser class are created, ...
    (microsoft.public.dotnet.framework.aspnet)