Creating a Custom Membership Provider

Discussion in 'ASP .Net Security' started by Ryan, Jun 26, 2006.

  1. Ryan

    Ryan Guest

    I'm referring to this Microsoft article in regards to creating a custom
    membership provider:
    http://msdn2.microsoft.com/en-us/library/ms366730(d=ide).aspx

    I'm in the process of creating my own membership provider and just want to
    make sure I get everything set up correctly with regards to the custom data
    I need to store on each user. In this article, the membership provider is
    inherited and all the methods are recreated to work with the custom
    provider. Is that all really nessessary? I have my membership provider set
    up and everything works (as far as logging in, etc.). Why not just add all
    your custom fields to the existing aspnet_membership table?

    Also in the above article, the only difference as far as fields in the table
    are 2 new fields; isSubscriber (boolean) and CustomerID (string). So to me
    it looks like it is intended that a 3rd table will be created to store user
    information (in addition to aspnet_membership and aspnet_users) and the
    CustomerID is a Foreign Key for this table. If that is the case why is the
    field isSubscriber not stored in the new Customer table rather than the
    aspnet_membership table?

    Any information in addition to this one article about setting up custom
    Membership would be helpful.

    Thanks,
    Ryan
     
    Ryan, Jun 26, 2006
    #1
    1. Advertising

  2. Hello Ryan,

    The article is only part of the whole solution, it also refer another
    article: How to: Sample Membership Provider
    Implementation(http://msdn2.microsoft.com/en-us/library/6tc47t75.aspx). It
    uses totally different data source than original ASPNETSQLmembership
    provider. So, it didn't add two customized fields, it created a brand new
    table to save all the required fileds:

    CREATE TABLE Users
    (
    PKID Guid NOT NULL PRIMARY KEY,
    Username Text (255) NOT NULL,
    ApplicationName Text (255) NOT NULL,
    Email Text (128) NOT NULL,
    Comment Text (255),
    Password Text (128) NOT NULL,
    PasswordQuestion Text (255),
    PasswordAnswer Text (255),
    IsApproved YesNo,
    LastActivityDate DateTime,
    LastLoginDate DateTime,
    LastPasswordChangedDate DateTime,
    CreationDate DateTime,
    IsOnLine YesNo,
    IsLockedOut YesNo,
    LastLockedOutDate DateTime,
    FailedPasswordAttemptCount Integer,
    FailedPasswordAttemptWindowStart DateTime,
    FailedPasswordAnswerAttemptCount Integer,
    FailedPasswordAnswerAttemptWindowStart DateTime,
    IsSubscriber YesNo,
    CustomerID Text (64)
    )

    If you have further questions, please feel free to let us know.

    Luke Zhang
    Microsoft Online Community Lead

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Luke Zhang [MSFT], Jun 27, 2006
    #2
    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. sloan
    Replies:
    5
    Views:
    1,537
    sloan
    Jun 4, 2006
  2. Replies:
    0
    Views:
    780
  3. sloan
    Replies:
    1
    Views:
    556
    Chad Scharf
    Jul 3, 2007
  4. Creating custom Membership Provider

    , Dec 14, 2005, in forum: ASP .Net Security
    Replies:
    4
    Views:
    253
  5. Brett Ossman

    Custom Membership Provider - Custom Error Messages

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

Share This Page