roleManager using a Custom role provider

Discussion in 'ASP .Net Security' started by John Toop, Jun 8, 2009.

  1. John Toop

    John Toop Guest

    I've read a number of places that give examples of how to do this but I could
    never get it. Most examples used forms authentication but I found if
    difficult to understand which steps were important and which weren't, so
    here's my contribution:

    I created a <roleManager ... /roleManager> tag inside <system.web>

    it was a lot simpler than I thought

    <roleManager defaultProvider="myRoleProvider" enabled="true">
    <providers>
    <clear/>
    <add name="myRoleProvider" type="Humber.Roles.myRoleProvider" />
    </providers>
    </roleManager>

    Where I got caught was I had no idea that the custom class had to reside
    within a nameSpace (I put a nameSpace somename ... End nameSpace around my
    class. I named my nameSpace "Humber.Roles" and my class I called
    myRoleProvider. The name of the "RoleProvider" that I created within my
    custom class became my roleProvider which was called as the defaultProvider.
    The type is the concatenation of the namespace and the class inside of it.
     
    John Toop, Jun 8, 2009
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QmVuIFIu?=

    debug a custom membership and role provider?

    =?Utf-8?B?QmVuIFIu?=, Mar 27, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    4,162
    =?Utf-8?B?dWxyaWNoIHNjaHVtYWNoZXI=?=
    May 17, 2006
  2. CK

    Custom Role Provider

    CK, Jul 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    5,266
    Winista
    Jul 25, 2006
  3. Alias
    Replies:
    5
    Views:
    871
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Feb 18, 2007
  4. J
    Replies:
    0
    Views:
    1,298
  5. Tom Van den Brandt

    Custom role provider not working

    Tom Van den Brandt, May 31, 2007, in forum: ASP .Net
    Replies:
    8
    Views:
    6,430
    rwiethorn
    Jun 11, 2007
  6. sloan
    Replies:
    1
    Views:
    690
    Chad Scharf
    Jul 3, 2007
  7. =?Utf-8?B?QXJuZQ==?=

    Authorization with custom role provider

    =?Utf-8?B?QXJuZQ==?=, Aug 17, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    566
    =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?=
    Aug 17, 2007
  8. James Crosswell

    Tracing problems with Custom Role Provider

    James Crosswell, Nov 8, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    586
    James Crosswell
    Nov 9, 2007
Loading...