Creating a Custom Membership Provider

R

Ryan

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
 
L

Luke Zhang [MSFT]

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

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top