Home All Groups Group Topic Archive Search About

2.0 Custom Membership Provider!

Author
6 Jan 2006 6:31 AM
Adam J Knight
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.");

}

Author
6 Jan 2006 7:21 AM
Ken Cox - Microsoft MVP
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



Show quote
"Adam J Knight" <adam.jkni***@optusnet.com.au> wrote in message
news:OUbfWroEGHA.1288@TK2MSFTNGP09.phx.gbl...
> 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.");
>
> }
>
>
Author
6 Jan 2006 8:00 AM
Adam J Knight
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
Author
6 Jan 2006 7:29 PM
clintonG
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/


Show quote
"Adam J Knight" <adam.jkni***@optusnet.com.au> wrote in message
news:OsC5RdpEGHA.2036@TK2MSFTNGP14.phx.gbl...
> 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
>
>

AddThis Social Bookmark Button