473,386 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

providerUserKey ASP.NET Membershipp

I am implementing a Custom Provider for ASP.NET 2.0 membership. When I come
to write the
public override MembershipUser CreateUser(string username, string password,
string email, string passwordQuestion, string passwordAnswer, bool
isApproved, object providerUserKey, out MembershipCreateStatus status)

{

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

What do I do with the providerUserKey object?? I know it is used for a key,
but I am unsure what i use it for?

If there is a proper implementation for SQL Providers I would much
appreciate it if you could point me in the right direction. I've seen a lot
of half baked solutions which don't work out there.

Many thanks.
Nov 19 '05 #1
5 3886
The providerUserKey is a provider specific ID for the user. The problem is
that you may have 2 diff applications configured to use the same provider
and the same DB, and you may get 2 diff users in those 2 diff apps with the
same username. Those are diff users, so you need a way to distinguish between
them. So, use an identity column :)

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am implementing a Custom Provider for ASP.NET 2.0 membership. When
I come
to write the
public override MembershipUser CreateUser(string username, string
password,
string email, string passwordQuestion, string passwordAnswer, bool
isApproved, object providerUserKey, out MembershipCreateStatus status)
{

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

}

What do I do with the providerUserKey object?? I know it is used for
a key, but I am unsure what i use it for?

If there is a proper implementation for SQL Providers I would much
appreciate it if you could point me in the right direction. I've seen
a lot of half baked solutions which don't work out there.

Many thanks.


Nov 19 '05 #2
Thanks for Brock's informative inputs.

Hi Davie,

As Brock has mentioned, the providerUserKey is just a idenitifier for the
membership user record. More exactly, it's just like a PK value for that
user record. For distinguish users with same username in different
application, most providers will use an "ApplicationName" pareameter (not
this providerUserKey) which could be generated from your asp.net
application's name. For example, the SqlMemberShipProvider just implement
as this, it use a "ApplicationName" parameter field in table to distinguish
users between applications. and the providerUserKey is expected as a Guid
object for identifying each user record.

Also, when we implementing our own custom membershipProvider, whether to
pass this field all depend on your database structure or storage details.
For example, if your underlying user datatable has an Autogenerated primary
key column, we don't need to force the application (consumer) to manually
pass in this providerUserKey. We just let the database to autogenerated ID
and return it to the consumer (through the returned MemberShipUser) after
completing the create operation. BTW, if you have interests, you can use
the reflector tool to have a look at the buildin SqlMemberShipProvider's
code which may give you some ideas on it.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Message-ID: <11***********************@msnews.microsoft.com>
| From: Brock Allen <ba****@NOSPAMdevelop.com>
| Subject: Re: providerUserKey ASP.NET Membershipp
| References: <O0**************@TK2MSFTNGP12.phx.gbl>
| Mime-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Content-Type: text/plain; charset=iso-8859-1; format=flowed
| X-Newsreader: JetBrains Omea Reader 469.1
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Date: Thu, 01 Sep 2005 18:55:13 -0700
| NNTP-Posting-Host: 12.162.27.25
| Lines: 1
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:121888
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| The providerUserKey is a provider specific ID for the user. The problem
is
| that you may have 2 diff applications configured to use the same provider
| and the same DB, and you may get 2 diff users in those 2 diff apps with
the
| same username. Those are diff users, so you need a way to distinguish
between
| them. So, use an identity column :)
|
| -Brock
| DevelopMentor
| http://staff.develop.com/ballen
|
|
|
| > I am implementing a Custom Provider for ASP.NET 2.0 membership. When
| > I come
| > to write the
| > public override MembershipUser CreateUser(string username, string
| > password,
| > string email, string passwordQuestion, string passwordAnswer, bool
| > isApproved, object providerUserKey, out MembershipCreateStatus status)
| > {
| >
| > throw new Exception("The method or operation is not implemented.");
| >
| > }
| >
| > What do I do with the providerUserKey object?? I know it is used for
| > a key, but I am unsure what i use it for?
| >
| > If there is a proper implementation for SQL Providers I would much
| > appreciate it if you could point me in the right direction. I've seen
| > a lot of half baked solutions which don't work out there.
| >
| > Many thanks.
| >
|

|
|

Nov 19 '05 #3
Thanks very much. This is much appreciated.
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:ed**************@TK2MSFTNGXA01.phx.gbl...
Thanks for Brock's informative inputs.

Hi Davie,

As Brock has mentioned, the providerUserKey is just a idenitifier for the
membership user record. More exactly, it's just like a PK value for that
user record. For distinguish users with same username in different
application, most providers will use an "ApplicationName" pareameter (not
this providerUserKey) which could be generated from your asp.net
application's name. For example, the SqlMemberShipProvider just implement
as this, it use a "ApplicationName" parameter field in table to
distinguish
users between applications. and the providerUserKey is expected as a Guid
object for identifying each user record.

Also, when we implementing our own custom membershipProvider, whether to
pass this field all depend on your database structure or storage details.
For example, if your underlying user datatable has an Autogenerated
primary
key column, we don't need to force the application (consumer) to manually
pass in this providerUserKey. We just let the database to autogenerated ID
and return it to the consumer (through the returned MemberShipUser) after
completing the create operation. BTW, if you have interests, you can use
the reflector tool to have a look at the buildin SqlMemberShipProvider's
code which may give you some ideas on it.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Message-ID: <11***********************@msnews.microsoft.com>
| From: Brock Allen <ba****@NOSPAMdevelop.com>
| Subject: Re: providerUserKey ASP.NET Membershipp
| References: <O0**************@TK2MSFTNGP12.phx.gbl>
| Mime-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Content-Type: text/plain; charset=iso-8859-1; format=flowed
| X-Newsreader: JetBrains Omea Reader 469.1
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Date: Thu, 01 Sep 2005 18:55:13 -0700
| NNTP-Posting-Host: 12.162.27.25
| Lines: 1
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:121888
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| The providerUserKey is a provider specific ID for the user. The problem
is
| that you may have 2 diff applications configured to use the same
provider
| and the same DB, and you may get 2 diff users in those 2 diff apps with
the
| same username. Those are diff users, so you need a way to distinguish
between
| them. So, use an identity column :)
|
| -Brock
| DevelopMentor
| http://staff.develop.com/ballen
|
|
|
| > I am implementing a Custom Provider for ASP.NET 2.0 membership. When
| > I come
| > to write the
| > public override MembershipUser CreateUser(string username, string
| > password,
| > string email, string passwordQuestion, string passwordAnswer, bool
| > isApproved, object providerUserKey, out MembershipCreateStatus status)
| > {
| >
| > throw new Exception("The method or operation is not implemented.");
| >
| > }
| >
| > What do I do with the providerUserKey object?? I know it is used for
| > a key, but I am unsure what i use it for?
| >
| > If there is a proper implementation for SQL Providers I would much
| > appreciate it if you could point me in the right direction. I've seen
| > a lot of half baked solutions which don't work out there.
| >
| > Many thanks.
| >
|

|
|

Nov 19 '05 #4
You're welcome Davie,

Have a good weekend!

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Davie" <Da***@newsgroup.nospam>
| References: <O0**************@TK2MSFTNGP12.phx.gbl>
<11***********************@msnews.microsoft.com>
<ed**************@TK2MSFTNGXA01.phx.gbl>
| Subject: Re: providerUserKey ASP.NET Membershipp
| Date: Fri, 2 Sep 2005 09:04:55 +0100
| Lines: 102
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <OQ**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 82-41-9-147.cable.ubr02.edin.blueyonder.co.uk
82.41.9.147
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:121937
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks very much. This is much appreciated.
|
|
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:ed**************@TK2MSFTNGXA01.phx.gbl...
| > Thanks for Brock's informative inputs.
| >
| > Hi Davie,
| >
| > As Brock has mentioned, the providerUserKey is just a idenitifier for
the
| > membership user record. More exactly, it's just like a PK value for that
| > user record. For distinguish users with same username in different
| > application, most providers will use an "ApplicationName" pareameter
(not
| > this providerUserKey) which could be generated from your asp.net
| > application's name. For example, the SqlMemberShipProvider just
implement
| > as this, it use a "ApplicationName" parameter field in table to
| > distinguish
| > users between applications. and the providerUserKey is expected as a
Guid
| > object for identifying each user record.
| >
| > Also, when we implementing our own custom membershipProvider, whether to
| > pass this field all depend on your database structure or storage
details.
| > For example, if your underlying user datatable has an Autogenerated
| > primary
| > key column, we don't need to force the application (consumer) to
manually
| > pass in this providerUserKey. We just let the database to autogenerated
ID
| > and return it to the consumer (through the returned MemberShipUser)
after
| > completing the create operation. BTW, if you have interests, you can
use
| > the reflector tool to have a look at the buildin
SqlMemberShipProvider's
| > code which may give you some ideas on it.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | Message-ID: <11***********************@msnews.microsoft.com>
| > | From: Brock Allen <ba****@NOSPAMdevelop.com>
| > | Subject: Re: providerUserKey ASP.NET Membershipp
| > | References: <O0**************@TK2MSFTNGP12.phx.gbl>
| > | Mime-Version: 1.0
| > | Content-Transfer-Encoding: 8bit
| > | Content-Type: text/plain; charset=iso-8859-1; format=flowed
| > | X-Newsreader: JetBrains Omea Reader 469.1
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | Date: Thu, 01 Sep 2005 18:55:13 -0700
| > | NNTP-Posting-Host: 12.162.27.25
| > | Lines: 1
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:121888
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | The providerUserKey is a provider specific ID for the user. The
problem
| > is
| > | that you may have 2 diff applications configured to use the same
| > provider
| > | and the same DB, and you may get 2 diff users in those 2 diff apps
with
| > the
| > | same username. Those are diff users, so you need a way to distinguish
| > between
| > | them. So, use an identity column :)
| > |
| > | -Brock
| > | DevelopMentor
| > | http://staff.develop.com/ballen
| > |
| > |
| > |
| > | > I am implementing a Custom Provider for ASP.NET 2.0 membership.
When
| > | > I come
| > | > to write the
| > | > public override MembershipUser CreateUser(string username, string
| > | > password,
| > | > string email, string passwordQuestion, string passwordAnswer, bool
| > | > isApproved, object providerUserKey, out MembershipCreateStatus
status)
| > | > {
| > | >
| > | > throw new Exception("The method or operation is not implemented.");
| > | >
| > | > }
| > | >
| > | > What do I do with the providerUserKey object?? I know it is used
for
| > | > a key, but I am unsure what i use it for?
| > | >
| > | > If there is a proper implementation for SQL Providers I would much
| > | > appreciate it if you could point me in the right direction. I've
seen
| > | > a lot of half baked solutions which don't work out there.
| > | >
| > | > Many thanks.
| > | >
| > |
| >
| > |
| > |
| >
|
|
|

Nov 19 '05 #5
Brock,
shoot me an email please - va******@hotmail.com

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET
-------------------------------------------------------

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:11***********************@msnews.microsoft.co m...
The providerUserKey is a provider specific ID for the user. The problem is
that you may have 2 diff applications configured to use the same provider
and the same DB, and you may get 2 diff users in those 2 diff apps with the same username. Those are diff users, so you need a way to distinguish between them. So, use an identity column :)

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am implementing a Custom Provider for ASP.NET 2.0 membership. When
I come
to write the
public override MembershipUser CreateUser(string username, string
password,
string email, string passwordQuestion, string passwordAnswer, bool
isApproved, object providerUserKey, out MembershipCreateStatus status)
{

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

}

What do I do with the providerUserKey object?? I know it is used for
a key, but I am unsure what i use it for?

If there is a proper implementation for SQL Providers I would much
appreciate it if you could point me in the right direction. I've seen
a lot of half baked solutions which don't work out there.

Many thanks.


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Erik Funkenbusch | last post by:
ASP.NET 2.0 I have a SqlDataSource that i'd like to pass the UserID of the user defined by the Membership provider. So, I thought I'd do something like this: <asp:SqlDataSource...
0
by: brett_fyisystems | last post by:
I'm trying to implement an inherited MembershipUser class for a custom MembershipProver for RTM ASP.NET 2.0 I'm using an external assembly that implements these classes. I've signed the...
8
by: Mark Olbert | last post by:
I'm writing a custom MembershipProvider which uses a custom class derived from MembershipUser (basically, the derived class adds a field to the MembershipUser base class). When I try to configure...
0
by: Fossie | last post by:
Hi, I need to check that someone signing up is listed in an xml file. I am using a customer membership provider for Access and trying to integrate the xml check into that. Am I on the right track?...
2
by: ad | last post by:
I use login control of VS2005 in my web application. The web applicaiton is developed in my notebook. It run ok in my notebook, but when I login in from another PC with the user ID and password,...
0
by: =?Utf-8?B?TWFoYXZpcg==?= | last post by:
Can you please alaborate how you fixed this? When we observed that for some(very less in fact) users, our forms authentication based .NET application not letting them login. When we checked we...
4
by: Cirene | last post by:
Using asp.net membership. My login.aspx page goes to the loginredirect.aspx page after the user logs in. For some reason "Membership.GetUser.ProviderUserKey.ToString" gives me this error:...
3
by: Cirene | last post by:
I'm creating my own create user wizard. Here's my code... If Membership.GetUser(txtEzUsername.Text).ProviderUserKey.ToString <"" Then Me.lblStatus.Text = "Username is in use. Please select...
0
by: para15000 | last post by:
Hello, I am working on a single sign on sollution for two different websites. I am trying to make the methods in my customized(overriden) provider post to a web service and get the results from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.