Click here to Skip to main content
15,894,539 members
Articles / Web Development

Service Based Membership Providers for ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.93/5 (45 votes)
4 May 2014CPOL29 min read 132.1K   8.2K   173  
Service based, multi-application ASP.NET custom membership, role and profile providers with a hierarchical role system.
<html xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp"><head><link rel="SHORTCUT ICON" href="./../icons/favicon.ico" /><style type="text/css">.OH_CodeSnippetContainerTabLeftActive, .OH_CodeSnippetContainerTabLeft,.OH_CodeSnippetContainerTabLeftDisabled { backgroundImageName: tabLeftBG.gif; }.OH_CodeSnippetContainerTabRightActive, .OH_CodeSnippetContainerTabRight,.OH_CodeSnippetContainerTabRightDisabled { backgroundImageName: tabRightBG.gif; }.OH_footer { backgroundImageName: footer_slice.gif; background-position: top; background-repeat: repeat-x; }</style><link rel="stylesheet" type="text/css" href="./../styles/branding.css" /><link rel="stylesheet" type="text/css" href="./../styles/branding-en-US.css" /><style type="text/css">
			body
			{
			border-left:5px solid #e6e6e6;
			overflow-x:scroll;
			overflow-y:scroll;
			}
		</style><script src="./../scripts/branding.js" type="text/javascript"><!----></script><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>AspNetRoleProvider Class</title><meta name="Language" content="en-us" /><meta name="System.Keywords" content="AspNetRoleProvider class" /><meta name="System.Keywords" content="Archymeta.Web.Security.AspNetRoleProvider class" /><meta name="System.Keywords" content="AspNetRoleProvider class, about AspNetRoleProvider class" /><meta name="Microsoft.Help.F1" content="Archymeta.Web.Security.AspNetRoleProvider" /><meta name="Microsoft.Help.Id" content="T:Archymeta.Web.Security.AspNetRoleProvider" /><meta name="Description" content="Provider for Asp.Net hierarchic role management using the Membership Data Service." /><meta name="Microsoft.Help.ContentType" content="Reference" /><meta name="BrandingAware" content="'true'" /><meta name="container" content="Archymeta.Web.Security" /><meta name="file" content="02260419-9f33-2bd7-00cf-2d8062fd6e46" /><meta name="guid" content="02260419-9f33-2bd7-00cf-2d8062fd6e46" /><link type="text/css" rel="stylesheet" href="ms-help://Hx/HxRuntime/HxLink.css" /><meta name="SelfBranded" content="true" /></head><body onload="onLoad()" class="primary-mtps-offline-document"><div class="OH_outerDiv"><div class="OH_outerContent"><table class="TitleTable"><tr><td class="OH_tdTitleColumn">AspNetRoleProvider Class</td><td class="OH_tdRunningTitleColumn">Service Proxy API for Membership data sources</td></tr></table><div id="mainSection"><div id="mainBody"><span class="introStyle"></span><p style="color: #dc143c; font-size: 8.5pt; font-weight: bold;">[This is preliminary documentation and is subject to change.]</p><div class="summary">
            Provider for Asp.Net hierarchic role management using the Membership Data Service.
            </div><div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Inheritance Hierarchy</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"></div><img src="./../icons/online_icon.gif" class="OH_offlineIcon" alt="Online" title="Online" /><a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">System<span id="ID0EBKNAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBKNAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>Object</a><br />  <img src="./../icons/online_icon.gif" class="OH_offlineIcon" alt="Online" title="Online" /><a href="http://msdn2.microsoft.com/en-us/library/5x9wbz2y" target="_blank">System.Configuration.Provider<span id="ID0EBHNAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBHNAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>ProviderBase</a><br />    <img src="./../icons/online_icon.gif" class="OH_offlineIcon" alt="Online" title="Online" /><a href="http://msdn2.microsoft.com/en-us/library/kkdz3641" target="_blank">System.Web.Security<span id="ID0EBENAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBENAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>RoleProvider</a><br />      <span class="selflink">Archymeta.Web.Security<span id="ID0EBBNAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBBNAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>AspNetRoleProvider</span><br /><p></p><b>Namespace:</b> <a href="bcc47ac0-24ce-49cf-165f-b977af57e4ec.htm" target="">Archymeta.Web.Security</a><br /><b>Assembly:</b> <span sdata="assembly">AspNetUserServiceProvider</span> (in AspNetUserServiceProvider.dll) Version: 1.0.0.0 (1.0.0.0)<div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Syntax</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"></div><div id="snippetGroup_Syntax" class="code"><div id="ID0EDADAAAAA" class="OH_CodeSnippetContainer"><div class="OH_CodeSnippetContainerTabs" id="ID0EDADAAAAA_tabs"><div class="OH_CodeSnippetContainerTabLeftActive" id="ID0EDADAAAAA_tabimgleft"></div><div id="ID0EDADAAAAA_tab1" class="OH_CodeSnippetContainerTabActive" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDADAAAAA','C#','1','4');return false;">C#</a></div><div id="ID0EDADAAAAA_tab2" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDADAAAAA','Visual Basic','2','4');return false;">VB</a></div><div id="ID0EDADAAAAA_tab3" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDADAAAAA','Visual C++','3','4');return false;">C++</a></div><div id="ID0EDADAAAAA_tab4" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDADAAAAA','F#','4','4');return false;">F#</a></div><div class="OH_CodeSnippetContainerTabRight" id="ID0EDADAAAAA_tabimgright"></div></div><div id="ID0EDADAAAAA_codecollection" class="OH_CodeSnippetContainerCodeCollection"><div class="OH_CodeSnippetToolBar"><div class="OH_CodeSnippetToolBarText"><a id="ID0EDADAAAAA_ViewColorized" href="#" onclick="javascript:ExchangeTitleContent('ID0EDADAAAAA','4')" title="View Colorized" style="display: none">View Colorized</a><a id="ID0EDADAAAAA_copycode" href="#" onclick="javascript:CopyToClipboard('ID0EDADAAAAA','4')" title="Copy to Clipboard">Copy to Clipboard</a><a id="ID0EDADAAAAA_PrintText" class="OH_PrintText" href="#" onclick="javascript:Print('ID0EDADAAAAA','4')" title="Print">Print</a></div></div><div id="ID0EDADAAAAA_code_Div1" class="OH_CodeSnippetContainerCode" style="display: block"><pre><span class="keyword">public</span> <span class="keyword">sealed</span> <span class="keyword">class</span> <span class="identifier">AspNetRoleProvider</span> : <span class="identifier">RoleProvider</span></pre></div><div id="ID0EDADAAAAA_code_Plain_Div1" class="OH_CodeSnippetContainerCode" style="display: none"><pre>public sealed class AspNetRoleProvider : RoleProvider</pre></div><div id="ID0EDADAAAAA_code_Div2" class="OH_CodeSnippetContainerCode" style="display: none"><pre><span class="keyword">Public</span> <span class="keyword">NotInheritable</span> <span class="keyword">Class</span> <span class="identifier">AspNetRoleProvider</span> 
	<span class="keyword">Inherits</span> <span class="identifier">RoleProvider</span></pre></div><div id="ID0EDADAAAAA_code_Plain_Div2" class="OH_CodeSnippetContainerCode" style="display: none"><pre>Public NotInheritable Class AspNetRoleProvider 
	Inherits RoleProvider</pre></div><div id="ID0EDADAAAAA_code_Div3" class="OH_CodeSnippetContainerCode" style="display: none"><pre><span class="keyword">public</span> <span class="keyword">ref class</span> <span class="identifier">AspNetRoleProvider</span> <span class="keyword">sealed</span> : <span class="keyword">public</span> <span class="identifier">RoleProvider</span></pre></div><div id="ID0EDADAAAAA_code_Plain_Div3" class="OH_CodeSnippetContainerCode" style="display: none"><pre>public ref class AspNetRoleProvider sealed : public RoleProvider</pre></div><div id="ID0EDADAAAAA_code_Div4" class="OH_CodeSnippetContainerCode" style="display: none"><pre>[&lt;<span class="identifier">SealedAttribute</span>&gt;]
<span class="keyword">type</span> <span class="identifier">AspNetRoleProvider</span> =  
    <span class="keyword">class</span> 
        <span class="keyword">inherit</span> <span class="identifier">RoleProvider</span> 
    <span class="keyword">end</span></pre></div><div id="ID0EDADAAAAA_code_Plain_Div4" class="OH_CodeSnippetContainerCode" style="display: none"><pre>[&lt;SealedAttribute&gt;]
type AspNetRoleProvider =  
    class 
        inherit RoleProvider 
    end</pre></div></div></div><script>addSpecificTextLanguageTagSet('ID0EDADAAAAA');</script></div><div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Remarks</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"></div>
            Hierarchic role system make it possible for more refined user access control.
            It allows the following logic to be implemented:
            namely a user having a role has also all the roles corresponding to all (if any)
            of the direct or indirect parent roles of the said role. For example, a user having
            role "Administrators.System" can not only access resources
            requiring "Administrators.System" role but also the
            ones requiring "Administrators" role. However, a user having
            "Administrators" role can not access more restrictive resources
            requiring "Administrators.System" role.
            <a name="seeAlsoSection"><!----></a><div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">See Also</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"></div><div class="seeAlsoStyle"><a href="09a1c11b-5496-e62f-0e49-3c59df1e65b7.htm" target="">AspNetRoleProvider Members</a></div><div class="seeAlsoStyle"><a href="bcc47ac0-24ce-49cf-165f-b977af57e4ec.htm" target="">Archymeta.Web.Security Namespace</a></div></div></div></div></div><div id="OH_footer" class="OH_footer"><p /><div class="OH_feedbacklink"><a href="mailto:?subject=Service+Proxy+API+for+Membership+data+sources+AspNetRoleProvider+Class+100+EN-US&amp;body=Your%20feedback%20is%20used%20to%20improve%20the%20documentation%20and%20the%20product.%20Your%20e-mail%20address%20will%20not%20be%20used%20for%20any%20other%20purpose%20and%20is%20disposed%20of%20after%20the%20issue%20you%20report%20is%20resolved.%20While%20working%20to%20resolve%20the%20issue%20that%20you%20report%2c%20you%20may%20be%20contacted%20via%20e-mail%20to%20get%20further%20details%20or%20clarification%20on%20the%20feedback%20you%20sent.%20After%20the%20issue%20you%20report%20has%20been%20addressed%2c%20you%20may%20receive%20an%20e-mail%20to%20let%20you%20know%20that%20your%20feedback%20has%20been%20addressed.">Send Feedback</a> on this topic.</div></div></body></html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder CryptoGateway Software Inc.
Canada Canada


His interests in software research and development include security, domain specific meta-language development technologies and tools, meta-language driven code generation, generation of non-invasive and virtual SQL database for "un-structured" data (sqlization), automated relational data service production technologies, file system sqlization technologies and products, structured multi-lingual documentation tools and technologies, sqlization of user's personal data, like emails, etc..


He was a physicist before year 2000. He studied theoretical physics (the hidden symmetry between the past and future, quantum field theories, mirror universe, cosmological dark energies etc.) in which he think to had made fundamental breakthroughs[^] but the community is either not ready for it or is actively rejecting/ignoring it Smile | :) .



It struck me on Apr. 11, 2023 that the said theory above can even generate General Relativity naturally after a recent discussion in the Insider News group that triggers a rethinking of the subject on my side. The first stage of the work is completed in Sept. 2023, it is and will be continue to be published online

  • On Vacuum
  • Quantum and Gravity







    Most recent software system to share:



    • V-NET[^] - Full stack virtualization management system including networking, storage, virtual machines and containers, with an emphasis on networking ... to be released.

Comments and Discussions