Membership when more info is needed for a User

Discussion in 'ASP .Net' started by Savvoulidis Iordanis, Jul 16, 2008.

  1. I use SQL Server Membership provider and my data are also stored in SQL
    Server. But the default user fields are not enough for my users info. So I
    created another Users table apart from aspnet_Membership. It has a
    PK(uniqueidentifier) to create the reference to aspnet_Membership table and
    my other info columns.
    Having read about the Custom Membership Provider in .NET help, it says that
    I should create a new object inherited from MembershipProvider and rewrite
    all of its methods so it can be used by the membership system calls.
    The question is:
    Why not inherit from SQLMembershipProvider instead of MembershipProvider?
    That way, most of the methods are already implemented and the only thing I
    would do is to override the CreateUser, UpdateUser, GetUser methods, that is,
    only a few
    .. In the 1st line of the overriden methods, I could use Mybase.CreateUser,
    Mybase.UpdateUser and so on, and just add the rest of the stuff I want to do
    to deal with my extra info.
    Am i in the right direction? I'd like a comment.

    TIA
    Iordanis
     
    Savvoulidis Iordanis, Jul 16, 2008
    #1
    1. Advertising

  2. Savvoulidis Iordanis

    sloan Guest

    You should look first at the Profile to see if its enough to help you.


    http://odetocode.com/Articles/440.aspx


    If you're using SqlServer, you ~can~ inherit from
    SQLMembershipProvider.

    Not everyone uses sql server obviously.



    "Savvoulidis Iordanis" <> wrote
    in message news:...
    >I use SQL Server Membership provider and my data are also stored in SQL
    > Server. But the default user fields are not enough for my users info. So I
    > created another Users table apart from aspnet_Membership. It has a
    > PK(uniqueidentifier) to create the reference to aspnet_Membership table
    > and
    > my other info columns.
    > Having read about the Custom Membership Provider in .NET help, it says
    > that
    > I should create a new object inherited from MembershipProvider and rewrite
    > all of its methods so it can be used by the membership system calls.
    > The question is:
    > Why not inherit from SQLMembershipProvider instead of MembershipProvider?
    > That way, most of the methods are already implemented and the only thing I
    > would do is to override the CreateUser, UpdateUser, GetUser methods, that
    > is,
    > only a few
    > . In the 1st line of the overriden methods, I could use Mybase.CreateUser,
    > Mybase.UpdateUser and so on, and just add the rest of the stuff I want to
    > do
    > to deal with my extra info.
    > Am i in the right direction? I'd like a comment.
    >
    > TIA
    > Iordanis
     
    sloan, Jul 16, 2008
    #2
    1. Advertising

  3. It doesn't. Only users with specific roles need to store extra info
     
    Savvoulidis Iordanis, Jul 16, 2008
    #3
  4. Savvoulidis Iordanis

    Junior Guest

    The use of the MembershipProvider is tightly integrated with Roles. You want
    to look at the Profile Table Provider ScottGu released after the Provider
    model intially released was found to be FUBAR.

    "Savvoulidis Iordanis" <> wrote
    in message news:...
    > It doesn't. Only users with specific roles need to store extra info
     
    Junior, Jul 16, 2008
    #4
  5. I also need the roles system. Also I studied it Scott Guthrie's work.
    Although it is very nice explained, I think I would give it a thumbs down.
    I'd prefer it if the profile table was generic and with fixed columns, and
    the profile properties were records in that table. Dealing with the property
    types, can be handled by examining the value_type field. I have done this
    project in the past, and it works like a charm and that's what I want to do
    now.
    (starting a parenthesis here)

    Table OPTIONS(userId, name, option_group_name, label, value, value_type,
    value_mask, SQL_needed, lower_limit, upper_limit, date_changed, comments,
    sort_order)

    That way, no changes are made to the table and stored procedures, when a new
    option is added or deleted. I'd like a comment on that, by Scott Guthrie if
    he sees this post. By the way, I very much like the way he explains his work,
    as I study it now and then. We need guys like him. (end of parenthesis).

    Going back to the membership issue, what I need is:
    If I inherit from the SqlMembershipProvider in order to just override some
    methods to add more info to my users, will the membership system be able to
    call my new overriden methods? I wouldn't like to rewrite the whole
    MemberShip provider from scratch by inheriting from MemberShipProvider class.

    TIA
     
    Savvoulidis Iordanis, Jul 21, 2008
    #5
    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. =?Utf-8?B?Um9iIEtheQ==?=

    Extend the Membership Provider to include more user data

    =?Utf-8?B?Um9iIEtheQ==?=, Jan 5, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    8,039
    Scott Allen
    Jan 6, 2006
  2. rdt
    Replies:
    0
    Views:
    386
  3. Michael
    Replies:
    4
    Views:
    467
    Matt Hammond
    Jun 26, 2006
  4. mazdotnet
    Replies:
    0
    Views:
    702
    mazdotnet
    Sep 12, 2007
  5. Matthew Loraditch

    Display Info Based on User's AD membership

    Matthew Loraditch, May 2, 2005, in forum: ASP General
    Replies:
    1
    Views:
    118
    Ray Costanzo [MVP]
    May 3, 2005
Loading...

Share This Page