Solved

Should I use Membership UserID or My Primary Key

Posted on 2010-08-31
2
349 Views
Last Modified: 2013-11-08
I am using asp.net 3.5 with the membership provider.
I added all the provider tables to my existing database using Aspnet_regsql.exe.
I added the userid, which is the data type uniqueidentifier, from the asp.net_users table generated by the membership provider, to my top level table.
The top level table primary key/identity key, is an int (PersonID). Since I used this primary key (PersonID) to relate tables in my original database, before adding membership provider, I just added the userid from the asp.net_users table, to my top level table.

Persons table
PersonID int Identity
UserID uniqueidentifier

Other Tables use PersonID as their FK.

Since this is a web app, I wanted to be sure that, for security reasons, using the PersonID was ok, or if I should change my tables to use the userid/uniqueidentifier instead of the PersonID as the FK.

Thanks
0
Comment
Question by:Sheritlw
2 Comments
 
LVL 32

Accepted Solution

by:
bhess1 earned 500 total points
Comment Utility
Depends on where you are using it.  If you place the PersonID on a link in your web code, it may make it easier to hack the system in some cases. If I had the option, I would use PersonID internally, and the guid externally (where it could be hacked).  
0
 

Author Comment

by:Sheritlw
Comment Utility
Thank you bhess1.

I will change the relationship fk to the user id.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now