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">
    <add name="myRoleProvider" type="Humber.Roles.myRoleProvider" />

    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. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.