how to process authentication and authorization

J

John_Woo

Hi,

for a web-app login checking, it's said the right-way is to process
authentication then to process authorization.

I'm wondering:

1. Does it mean it needs to connect database twice, each of which for
one of these two processings?

2. Does the table structure look like

name passwd role

if this is correct, then one connection can provide with role/passwd
info, so why we can't have one process to check and verify user/passwd
instead of two?

3. in Tomcat, tomcat-user.xml is the configuration for
user/passwd/role, is that secured to put these info in a file instead
of putting in DB?

Can any one clarify?
 
R

Raymond DeCampo

John_Woo said:
Hi,

for a web-app login checking, it's said the right-way is to process
authentication then to process authorization.

I'm wondering:

1. Does it mean it needs to connect database twice, each of which for
one of these two processings?

That depends. More below.
2. Does the table structure look like

name passwd role

if this is correct, then one connection can provide with role/passwd
info, so why we can't have one process to check and verify user/passwd
instead of two?

Don't confuse the needs of the business logic layer (or middle tier)
with the needs of the back end database. Make your database in a manner
that allows for efficient usage. You should have an abstraction layer
between the business logic and the database (e.g. DAO, EJB, hibernate,
etc.). It can worry about whether it needs to go to the database again
or if it has cached the information. Then your middle tier just asks
for the data it needs, when it needs it.
3. in Tomcat, tomcat-user.xml is the configuration for
user/passwd/role, is that secured to put these info in a file instead
of putting in DB?

As secure as your file system which may or may not be as secure as your
database. But much less convenient to change programatically.

HTH,
Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top