473,803 Members | 4,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Authentication in Asp.Net 2.0. Please, I need help. Thank You.

Hello,

I am working on an Asp.Net 2.0 / SQL 2005 web project where:
1. All users must login.
2. There will be two user types: student and professor.
The students and professors are not related.

IMPORTANT:
All students and professors will have a name, phone, ...
However, other information is specific to a user type.
Consider the following example:

INFORMATION on each student:
Name, Email, Phone, Age

INFORMATION on each professor:
Name, Email, Phone, Address, Position

To avoid blank fields on my database I created the following tables:

USERS_AUTH > Authentication information for all users.
FIELDS: [User_ID] (PK), [Username], [Password], [Role]

USERS_INFO > Personal information on students and professors
FIELDS: [UserInfo_ID] (PK), [User_ID] (FK), [Name],
[Phone]

STUDENTS > Personal information specific to students
Fields: [Student_ID] (PK), [UserInfo_ID] (FK), [Age]

PROFESSORS > Personal information specific to students
Fields: [Professor_ID] (PK), [UserInfo_ID] (FK), [Age]

- 'PK' and 'FK' stands for primary key and foreign key, respectively.
- [Role] in USERS_AUTH can be 'Student' or 'Professor'.

My database structure becomes as follows:

USERS_AUTH
|
USERS_INFO
| |
STUDENTS PROFESSORS

I created this structure based on the following:
a) Table USERS_AUTH is to be used by Membership API.
I believe I can't or I shouldn't put USERS_AUTH and USERS_INFO
together.
b) USERS_INFO, STUDENTS and PROFESSORS are to be used in
Personalization .
c) I created STUDENTS and PROFESSORS to avoid blank fields in my
database.
MY QUESTIONS ARE:

1. Is this the way to do it?
Are my assumptions in (a), (b) and (c) correct?

2. What are all the possible fields to be used on the table USERS_AUTH?

USERS_AUTH is to be used by Membership API.

I read some online documents and MSDN.

Sometimes there is the field PasswordQuestio n other times there
isn't.
Sometimes I see the field Role and other times there isn't.
I might be reading Beta 1 and Final release documents.

This is why I am asking for all fields to be used by Membership API.

3. I need to make user information available after login, for example:
- To display it on a page.
- To hide or show a web page part.
- To use in any other way.

User information differs from student and professor:
- USER_INFO and STUDENTS fields if the user is a student (Role =
Student)
- USER_INFO and PROFESSORS fields for students (Role = Professor).

How do I get this info?
How to I relate this with Personalization methods in Asp.Net 2.0.

I've read everything I could find but I am having problems putting this
together. I hope I, successfully, explained my problem.

Could, someone, please help me out?

Thank You Very Much,
Miguel

Jan 3 '06 #1
3 1744
On Tue, 3 Jan 2006 01:10:20 +0000, "Miguel Dias Moura"
<md*REMOVE*mour a@gmail*NOSPAM* .com> wrote:

I would use Forms Authentication.
See the help docs on Forms Authentication. There are several built-in
controls for handling it and several books with examples of it's use.

You should not keep the authentication data and the user data in the
same object.
Hello,

I am working on an Asp.Net 2.0 / SQL 2005 web project where:
1. All users must login.
2. There will be two user types: student and professor.
The students and professors are not related.

IMPORTANT:
All students and professors will have a name, phone, ...
However, other information is specific to a user type.
Consider the following example:

INFORMATION on each student:
Name, Email, Phone, Age

INFORMATION on each professor:
Name, Email, Phone, Address, Position

To avoid blank fields on my database I created the following tables:

USERS_AUTH > Authentication information for all users.
FIELDS: [User_ID] (PK), [Username], [Password], [Role]

USERS_INFO > Personal information on students and professors
FIELDS: [UserInfo_ID] (PK), [User_ID] (FK), [Name],
[Phone]

STUDENTS > Personal information specific to students
Fields: [Student_ID] (PK), [UserInfo_ID] (FK), [Age]

PROFESSORS > Personal information specific to students
Fields: [Professor_ID] (PK), [UserInfo_ID] (FK), [Age]

- 'PK' and 'FK' stands for primary key and foreign key, respectively.
- [Role] in USERS_AUTH can be 'Student' or 'Professor'.

My database structure becomes as follows:

USERS_AUTH
|
USERS_INFO
| |
STUDENTS PROFESSORS

I created this structure based on the following:
a) Table USERS_AUTH is to be used by Membership API.
I believe I can't or I shouldn't put USERS_AUTH and USERS_INFO
together.
b) USERS_INFO, STUDENTS and PROFESSORS are to be used in
Personalizatio n.
c) I created STUDENTS and PROFESSORS to avoid blank fields in my
database.
MY QUESTIONS ARE:

1. Is this the way to do it?
Are my assumptions in (a), (b) and (c) correct?

2. What are all the possible fields to be used on the table USERS_AUTH?

USERS_AUTH is to be used by Membership API.

I read some online documents and MSDN.

Sometimes there is the field PasswordQuestio n other times there
isn't.
Sometimes I see the field Role and other times there isn't.
I might be reading Beta 1 and Final release documents.

This is why I am asking for all fields to be used by Membership API.

3. I need to make user information available after login, for example:
- To display it on a page.
- To hide or show a web page part.
- To use in any other way.

User information differs from student and professor:
- USER_INFO and STUDENTS fields if the user is a student (Role =
Student)
- USER_INFO and PROFESSORS fields for students (Role = Professor).

How do I get this info?
How to I relate this with Personalization methods in Asp.Net 2.0.

I've read everything I could find but I am having problems putting this
together. I hope I, successfully, explained my problem.

Could, someone, please help me out?

Thank You Very Much,
Miguel


Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
Jan 3 '06 #2
I think its smarter to redesign your database design to function with
ASP.NET 2.0 Membership, Roles and Profiles.
Start by building this MSDN tutorial [1] and see if you don't agree after
you understand how easy it has become.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee. com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1]
http://msdn.microsoft.com/library/de...aght000014.asp

"Miguel Dias Moura" <md*REMOVE*mour a@gmail*NOSPAM* .com> wrote in message
news:eo******** ******@TK2MSFTN GP11.phx.gbl...
Hello,

I am working on an Asp.Net 2.0 / SQL 2005 web project where:
1. All users must login.
2. There will be two user types: student and professor.
The students and professors are not related.

IMPORTANT:
All students and professors will have a name, phone, ...
However, other information is specific to a user type.
Consider the following example:

INFORMATION on each student:
Name, Email, Phone, Age

INFORMATION on each professor:
Name, Email, Phone, Address, Position

To avoid blank fields on my database I created the following tables:

USERS_AUTH > Authentication information for all users.
FIELDS: [User_ID] (PK), [Username], [Password], [Role]

USERS_INFO > Personal information on students and professors
FIELDS: [UserInfo_ID] (PK), [User_ID] (FK), [Name], [Phone]

STUDENTS > Personal information specific to students
Fields: [Student_ID] (PK), [UserInfo_ID] (FK), [Age]

PROFESSORS > Personal information specific to students
Fields: [Professor_ID] (PK), [UserInfo_ID] (FK), [Age]

- 'PK' and 'FK' stands for primary key and foreign key, respectively.
- [Role] in USERS_AUTH can be 'Student' or 'Professor'.

My database structure becomes as follows:

USERS_AUTH
|
USERS_INFO
| |
STUDENTS PROFESSORS

I created this structure based on the following:
a) Table USERS_AUTH is to be used by Membership API.
I believe I can't or I shouldn't put USERS_AUTH and USERS_INFO together.
b) USERS_INFO, STUDENTS and PROFESSORS are to be used in Personalization .
c) I created STUDENTS and PROFESSORS to avoid blank fields in my database.
MY QUESTIONS ARE:
1. Is this the way to do it?
Are my assumptions in (a), (b) and (c) correct?

2. What are all the possible fields to be used on the table USERS_AUTH?

USERS_AUTH is to be used by Membership API.

I read some online documents and MSDN.

Sometimes there is the field PasswordQuestio n other times there isn't.
Sometimes I see the field Role and other times there isn't.
I might be reading Beta 1 and Final release documents.

This is why I am asking for all fields to be used by Membership API.

3. I need to make user information available after login, for example:
- To display it on a page.
- To hide or show a web page part.
- To use in any other way.

User information differs from student and professor:
- USER_INFO and STUDENTS fields if the user is a student (Role =
Student)
- USER_INFO and PROFESSORS fields for students (Role = Professor).

How do I get this info?
How to I relate this with Personalization methods in Asp.Net 2.0.

I've read everything I could find but I am having problems putting this
together. I hope I, successfully, explained my problem.

Could, someone, please help me out?

Thank You Very Much,
Miguel

Jan 3 '06 #3
You need to use: aspnet_regsql

To create the tables and such for forms authentication. Do it the MS
way, it will make your life a lot easier.

Then you can create web.config entries and manage roles and membership.

EX.
<connectionStri ngs>
<add name="ClientsDB " connectionStrin g="....."
ProviderName="S ystem.Data.SqlC lient" />
</connectionStrin gs>

<system.web>

<membership defaultProvider ="MySqlMembersh ipProvider" >
<providers>
<clear/>
<add name="MySqlMemb ershipProvider"
connectionStrin gName="ClientsD B"
applicationName ="/"
passwordFormat= "Hashed"
type="System.We b.Security.SqlM embershipProvid er" />
</providers>
</membership>

<roleManager enabled="true" defaultProvider ="MySqlRoleMana ger">
<providers>
<clear/>
<add name="MySqlRole Manager"
type="System.We b.Security.SqlR oleProvider"
connectionStrin gName="ClientsD B"
applicationName ="/" />
</providers>
</roleManager>

</system.web>

clintonG wrote:
I think its smarter to redesign your database design to function with
ASP.NET 2.0 Membership, Roles and Profiles.
Start by building this MSDN tutorial [1] and see if you don't agree after
you understand how easy it has become.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee. com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1]
http://msdn.microsoft.com/library/de...aght000014.asp

"Miguel Dias Moura" <md*REMOVE*mour a@gmail*NOSPAM* .com> wrote in message
news:eo******** ******@TK2MSFTN GP11.phx.gbl...
Hello,

I am working on an Asp.Net 2.0 / SQL 2005 web project where:
1. All users must login.
2. There will be two user types: student and professor.
The students and professors are not related.

IMPORTANT:
All students and professors will have a name, phone, ...
However, other information is specific to a user type.
Consider the following example:

INFORMATION on each student:
Name, Email, Phone, Age

INFORMATION on each professor:
Name, Email, Phone, Address, Position

To avoid blank fields on my database I created the following tables:

USERS_AUTH > Authentication information for all users.
FIELDS: [User_ID] (PK), [Username], [Password], [Role]

USERS_INFO > Personal information on students and professors
FIELDS: [UserInfo_ID] (PK), [User_ID] (FK), [Name], [Phone]

STUDENTS > Personal information specific to students
Fields: [Student_ID] (PK), [UserInfo_ID] (FK), [Age]

PROFESSORS > Personal information specific to students
Fields: [Professor_ID] (PK), [UserInfo_ID] (FK), [Age]

- 'PK' and 'FK' stands for primary key and foreign key, respectively.
- [Role] in USERS_AUTH can be 'Student' or 'Professor'.

My database structure becomes as follows:

USERS_AUTH
|
USERS_INFO
| |
STUDENTS PROFESSORS

I created this structure based on the following:
a) Table USERS_AUTH is to be used by Membership API.
I believe I can't or I shouldn't put USERS_AUTH and USERS_INFO together.
b) USERS_INFO, STUDENTS and PROFESSORS are to be used in Personalization .
c) I created STUDENTS and PROFESSORS to avoid blank fields in my database.
MY QUESTIONS ARE:
1. Is this the way to do it?
Are my assumptions in (a), (b) and (c) correct?

2. What are all the possible fields to be used on the table USERS_AUTH?

USERS_AUTH is to be used by Membership API.

I read some online documents and MSDN.

Sometimes there is the field PasswordQuestio n other times there isn't.
Sometimes I see the field Role and other times there isn't.
I might be reading Beta 1 and Final release documents.

This is why I am asking for all fields to be used by Membership API.

3. I need to make user information available after login, for example:
- To display it on a page.
- To hide or show a web page part.
- To use in any other way.

User information differs from student and professor:
- USER_INFO and STUDENTS fields if the user is a student (Role =
Student)
- USER_INFO and PROFESSORS fields for students (Role = Professor).

How do I get this info?
How to I relate this with Personalization methods in Asp.Net 2.0.

I've read everything I could find but I am having problems putting this
together. I hope I, successfully, explained my problem.

Could, someone, please help me out?

Thank You Very Much,
Miguel


Jan 3 '06 #4

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

Similar topics

6
4842
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms Authentication set up and it worked just fine. Then I realized that I needed to have some pages unsecure. I then created 2 directories. One named Secure and the other named Public. I placed my web.config file in my
1
3515
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The web.config file is configured as such: <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" name="myApplication"/> </authentication>
4
6811
by: Andrew | last post by:
Hey all, I would like to preface my question by stating I am still learning ASP.net and while I am confident in the basics and foundation, the more advanced stuff is still a challenge. Ok. :)
10
13890
by: Will Gillen | last post by:
I have an ASP.NET application that is using Windows Integrated Authentication (IIS) (as opposed to Forms Authentication). When the user first logs into the application, IIS prompts the user for their credentials. Once they are "authenticated", their credentials remain active while their web browser is open. Now, I want the "authentication" to "timeout" in 3 minutes. This way if they browse to another page after 3 minutes, they are...
2
1431
by: geodev | last post by:
Hello, I’m currently writing an asp.net application that will be running on a Windows XP Professional workstation utilising IIS and MSDE Database. At a later date this application will need to run on a Windows Server 2003 IIS web farm utilising either MSDE Database or SQL Server Database. I’m developing this application utilising Microsoft’s Development Environment 2002 version.
5
2316
by: wrytat | last post by:
I'm not sure if I'm posting the correct place. I posted it somewhere else, but someone told me to post it at another place. Anyway, some background first. I am currently building a web application for my company. This application is going to be hosted with an ISP on a shared server. And my company doesn't have a static IP. I want to make part of my web application such that only my company's computer can access (something like an...
2
1226
by: Shapper | last post by:
Hello, I am working in ASP.NET/VB and I need to create a login page. In login.aspx I have a dataset with the usernames, passwords and access level. How to create the login? And how to make the access level available in page_load so I can check the user access level and take the according action when each page is loaded?
8
2156
by: =?Utf-8?B?TFc=?= | last post by:
Hello! I am just learning about forms authentication so please excuse this basic question. I am using .NET 1.1 and C#. I have created my web.config file and my login.aspx and the associated cs file using examples on MSDN. I have created a FormsAuthenticationTicket and cookie and added the cookie to the response and then set the SetAuthCookie etc. When I go to the redirected page, I am not sure how to read the cookie value so I know who...
2
1879
by: Max2006 | last post by:
Hi, We prefer ASP.NET Forms Authentication in our ASP.NET 3.5 application; however we have to use Active Directory for user name and password storage. Is that possible? Is there any sample application to do this? Thank you, Max
0
10542
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10309
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9119
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7600
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6840
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5496
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4274
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 we have to send another system
3
2968
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.