2.0 Custom Membership Provider!

Discussion in 'ASP .Net' started by Adam J Knight, Jan 6, 2006.

  1. Hi all,

    I am in the process of creating a custom membership provider (ASP.NET 2.0):

    Currently I am inheriting from MembershipProvider which isn't a problem.

    However, the membership.CreateUser() methods signature doesn't seem
    relevant to my implementation.

    For example, i will be needing to store a users address details and not just
    their 'username' , 'password' and 'email'.
    Also the password Question & Answers will not be used.

    Is their someway i can adjust the CreateUser member signature?

    Thoughts & help appreciated!!!

    Cheers,
    Adam
    Current Code:

    public override System.Web.Security.MembershipUser CreateUser(string
    username, string password, string email, string passwordQuestion, string
    passwordAnswer, bool isApproved, object providerUserKey, out
    System.Web.Security.MembershipCreateStatus status)

    {

    throw new Exception("The method or operation is not implemented.");

    }
     
    Adam J Knight, Jan 6, 2006
    #1
    1. Advertising

  2. Isn't CreateUser() just the starting point? After that you use Profiles for
    the rest.

    Are you following the Access sample provider that you see on this page?

    http://msdn.microsoft.com/asp.net/downloads/providers/default.aspx



    "Adam J Knight" <> wrote in message
    news:...
    > Hi all,
    >
    > I am in the process of creating a custom membership provider (ASP.NET
    > 2.0):
    >
    > Currently I am inheriting from MembershipProvider which isn't a problem.
    >
    > However, the membership.CreateUser() methods signature doesn't seem
    > relevant to my implementation.
    >
    > For example, i will be needing to store a users address details and not
    > just their 'username' , 'password' and 'email'.
    > Also the password Question & Answers will not be used.
    >
    > Is their someway i can adjust the CreateUser member signature?
    >
    > Thoughts & help appreciated!!!
    >
    > Cheers,
    > Adam
    > Current Code:
    >
    > public override System.Web.Security.MembershipUser CreateUser(string
    > username, string password, string email, string passwordQuestion, string
    > passwordAnswer, bool isApproved, object providerUserKey, out
    > System.Web.Security.MembershipCreateStatus status)
    >
    > {
    >
    > throw new Exception("The method or operation is not implemented.");
    >
    > }
    >
    >
     
    Ken Cox - Microsoft MVP, Jan 6, 2006
    #2
    1. Advertising

  3. Hi Ken,

    Not sure how profiles relate to my current problem???

    I am not following any of the samples you listed
    Just not sure how to implement saving custom user ('member') info using a
    custom membership provider.

    In this instance a User('member') consists of the following attributes.

    For eg:
    - institution_id
    - name
    - phone
    - alt_phone
    - fax
    - email
    - website
    - address
    - suburb
    - state / city
    - post code
    - contact_fname
    - contact_lname
    - user_name
    - password
    - user_nbr
    - institution_type_id

    The CreateUser method doesn't compensate for such alterations.

    This is a tutorial i have refered to, but as mentioned .i am not customizing
    the datasource, just what is stored.

    http://www.devx.com/asp/Article/29256/0/page/1

    Cheers,
    Adam
     
    Adam J Knight, Jan 6, 2006
    #3
  4. Adam J Knight

    clintonG Guest

    Hello Adam,

    I have to do the same thing and the Profile object is in fact the 2.0 way to
    record and retrieve a user's properties. AFIK this data is not normalized
    and I can't see how it possibly could be but that's how it works performance
    issues being kept mum so far. For example, one thing that concerns me at the
    moment is it also seems that the object is populated with data each time the
    user logs in whether the data is needed or not as the properties must be
    defined in web.config.

    Our alternative seems to be the reuse of the aspnet_Users primary key used
    as a foreign key to table(s) of our own creation where we have to write the
    CRUD code ourselves.

    <%= Clinton Gallagher
    METROmilwaukee (sm) "A Regional Information Service"
    NET csgallagher AT metromilwaukee.com
    URL http://metromilwaukee.com/
    URL http://clintongallagher.metromilwaukee.com/


    "Adam J Knight" <> wrote in message
    news:...
    > Hi Ken,
    >
    > Not sure how profiles relate to my current problem???
    >
    > I am not following any of the samples you listed
    > Just not sure how to implement saving custom user ('member') info using a
    > custom membership provider.
    >
    > In this instance a User('member') consists of the following attributes.
    >
    > For eg:
    > - institution_id
    > - name
    > - phone
    > - alt_phone
    > - fax
    > - email
    > - website
    > - address
    > - suburb
    > - state / city
    > - post code
    > - contact_fname
    > - contact_lname
    > - user_name
    > - password
    > - user_nbr
    > - institution_type_id
    >
    > The CreateUser method doesn't compensate for such alterations.
    >
    > This is a tutorial i have refered to, but as mentioned .i am not
    > customizing the datasource, just what is stored.
    >
    > http://www.devx.com/asp/Article/29256/0/page/1
    >
    > Cheers,
    > Adam
    >
    >
     
    clintonG, Jan 6, 2006
    #4
    1. Advertising

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. John
    Replies:
    3
    Views:
    4,383
    stribbed
    Jun 21, 2007
  2. sloan
    Replies:
    5
    Views:
    1,515
    sloan
    Jun 4, 2006
  3. Replies:
    0
    Views:
    750
  4. sloan
    Replies:
    1
    Views:
    515
    Chad Scharf
    Jul 3, 2007
  5. Brett Ossman

    Custom Membership Provider - Custom Error Messages

    Brett Ossman, Mar 11, 2009, in forum: ASP .Net Security
    Replies:
    0
    Views:
    791
    Brett Ossman
    Mar 11, 2009
Loading...

Share This Page