473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Customized Membership Provider

Hi all,
We currently have our own customer/login tables in our database linked with
CustomerID columns of both tables. Some of the requirements of the system are

1) When I validate users, I need to pass more parameters than just
username/password, for example customers are created for different clients,
so I need to pass our ClientID with username/password together. We build one
portal to support multiple clients.

2) When a customer is validated, I need to get CustomerID instead of
username from Context.User.Identity.

By implementing MembershipProvider class, I don't think I can achieve any of
requirement mentioned above. Do I miss something or there are some other
tricks I don't know?

Thanks for any suggestions or comments!
--
Regards
Hardy
Feb 12 '07 #1
3 1607
You can certainly implement what you describe, you will need to write a
custom MembershipProvider that derives from the ProviderBase class.
There is plenty of sample code around for implementing custom Membership,
Profile, and Roles providers.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Hardy Wang" wrote:
Hi all,
We currently have our own customer/login tables in our database linked with
CustomerID columns of both tables. Some of the requirements of the system are

1) When I validate users, I need to pass more parameters than just
username/password, for example customers are created for different clients,
so I need to pass our ClientID with username/password together. We build one
portal to support multiple clients.

2) When a customer is validated, I need to get CustomerID instead of
username from Context.User.Identity.

By implementing MembershipProvider class, I don't think I can achieve any of
requirement mentioned above. Do I miss something or there are some other
tricks I don't know?

Thanks for any suggestions or comments!
--
Regards
Hardy
Feb 12 '07 #2
Sorry, I implemented MembershipProvider class, ValidateUser only accepts 2
parameters, but I need more.

public override bool ValidateUser(string username, string password) {
}

How can I do it?

Let me do a search around.
--
Regards
Hardy
"Peter Bromberg [C# MVP]" wrote:
You can certainly implement what you describe, you will need to write a
custom MembershipProvider that derives from the ProviderBase class.
There is plenty of sample code around for implementing custom Membership,
Profile, and Roles providers.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Hardy Wang" wrote:
Hi all,
We currently have our own customer/login tables in our database linked with
CustomerID columns of both tables. Some of the requirements of the system are

1) When I validate users, I need to pass more parameters than just
username/password, for example customers are created for different clients,
so I need to pass our ClientID with username/password together. We build one
portal to support multiple clients.

2) When a customer is validated, I need to get CustomerID instead of
username from Context.User.Identity.

By implementing MembershipProvider class, I don't think I can achieve any of
requirement mentioned above. Do I miss something or there are some other
tricks I don't know?

Thanks for any suggestions or comments!
--
Regards
Hardy
Feb 12 '07 #3
How about we create a ValidateUserEx method that accepts all your parameters,
and you forward the call with the username, password to the overridden base
class method?
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Hardy Wang" wrote:
Sorry, I implemented MembershipProvider class, ValidateUser only accepts 2
parameters, but I need more.

public override bool ValidateUser(string username, string password) {
}

How can I do it?

Let me do a search around.
--
Regards
Hardy
"Peter Bromberg [C# MVP]" wrote:
You can certainly implement what you describe, you will need to write a
custom MembershipProvider that derives from the ProviderBase class.
There is plenty of sample code around for implementing custom Membership,
Profile, and Roles providers.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Hardy Wang" wrote:
Hi all,
We currently have our own customer/login tables in our database linked with
CustomerID columns of both tables. Some of the requirements of the system are
>
1) When I validate users, I need to pass more parameters than just
username/password, for example customers are created for different clients,
so I need to pass our ClientID with username/password together. We build one
portal to support multiple clients.
>
2) When a customer is validated, I need to get CustomerID instead of
username from Context.User.Identity.
>
By implementing MembershipProvider class, I don't think I can achieve any of
requirement mentioned above. Do I miss something or there are some other
tricks I don't know?
>
Thanks for any suggestions or comments!
--
Regards
Hardy
Feb 12 '07 #4

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

Similar topics

2
by: WB | last post by:
Hi, I am revamping my company's website with ASP.Net 2.0. In order to use our existing user data in our SQL 2000, I have written a custom membership provider. However, when I try to logon with...
3
by: Morgan | last post by:
Sorry for cross post, forgot to include aspnet in orinal... Thanks in advance for any assistance. I'm in the process of implementing custom RoleProvider & Membership Provider objects and have...
2
by: John | last post by:
Hi I was working fine with create user wizard and the default membership provider. I have now customised the membership provider as per attached web.config. The create user wizard picks up the...
3
by: ad | last post by:
I have create a custom membership provider. The common usage of custom membership is set it as default Membership Provider win web.config, and use login controls with it. How can I use custom...
9
by: Paul Keegstra | last post by:
Hi, I am currently working on an asp.net 2.0 web site that is a replacement of a classic asp web site. The current web site uses a Commerce Server 2002 database for storing user information. ...
2
by: Balaji | last post by:
Hi All, Can I use more than one membership provider for a given website? I understand only one of them could be default one. If yes, then how to programmatically access the other membership...
3
by: ryan.mclean | last post by:
Hello everyone, I am wondering, can the membership provider be changed at runtime? Perhaps the connectionStringName? I would like to use a different database based on the server the site is...
4
by: thomas | last post by:
Hello All, How to change the default Membership Provider during the runtime? I know I can reference any provider I want, e.g.: provider = Membership.Providers but the question is how to...
4
by: =?Utf-8?B?Q2hyaXMgQ2Fw?= | last post by:
I have been having some trouble with implementing a custom Membership Provider. We have a custom data store and business logic that pulls user information. I need some level of functionality...
1
by: Ben | last post by:
Hi, When an anonymous user has created an new account (with the CreateUserWizard control), i want to let asp.net generate a password and to send it to the address of the email provided by the...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.