Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Should I use Membership UserID or My Primary Key

Posted on 2010-08-31
2
Medium Priority
?
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 32

Accepted Solution

by:
Brendt Hess earned 2000 total points
ID: 33571654
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
ID: 33572547
Thank you bhess1.

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

715 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