Solved

java user authentication

Posted on 2004-03-23
8
214 Views
Last Modified: 2010-03-31
Hi, I want to write efficient authentication, before I used a status variable in a mysql database to verify wether a user was an administrator or not, is this efficient, are there better methods?
0
Comment
Question by:Ronayne
  • 4
  • 4
8 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 10661581
Yeap this is the way you do it, unless you want to use a file instead of database. The other thing you can do is to have all roles defined in an XML file (that's how several application servers work) and then parse this XML file and find out which is administrator or not. But I'd go with the database option.
0
 

Author Comment

by:Ronayne
ID: 10661782

are there any advantages of using the xml option?, how could I go abouout this?
0
 
LVL 35

Expert Comment

by:girionis
ID: 10661863
The only advantage I can see is that you will not make the network trip (if db resides on a different server) to the db server and back. On the other hand processing an XML file with DOM requires more memory. I'd say it's mroe or less the same, with the database giving you the advantage of hashing the passwords as well (you can also hash them and encrypt them if you use an XML file).

> how could I go abouout this?

You basically have an XML file with all the relevant info and then you parse it (using either SAX or DOM) and get the desired information.

This is an excellent link to get you started with XML: http://www.ibiblio.org/xml/books/xmljava/
0
 

Author Comment

by:Ronayne
ID: 10661887

with xml, would'nt i be better to use xindice than creating a file?,
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Ronayne
ID: 10662040

ok, im finished with this comment, what advantages are there to storing a users status - administrator or user rather than just storing the status variable in a mysql database?
0
 
LVL 35

Accepted Solution

by:
girionis earned 50 total points
ID: 10662176
> with xml, would'nt i be better to use xindice than creating a file?,

xindice is also a database with the only difference that you store and retrieve your data as XML. AFAIK xindice uses XPath in order to find the appropriate XML data you need, so instead of you manualyl using XPath to do the sarching xindice does it for you.

> ok, im finished with this comment, what advantages are there to storing a users status - administrator
>or user rather than just storing the status variable in a mysql database?

The only disadvantage of using a db instead of an XML file *I* can see is the unecessary trip to the db server (if the server is on a different computer on another network).

It actually depends on how much data you have. If only a few records it could actually be faster to have the data in the XML file, load up the file and read the data.
0
 

Author Comment

by:Ronayne
ID: 10669706

Thanks for all your help, that great
0
 
LVL 35

Expert Comment

by:girionis
ID: 10671126
:)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 83
how do i compare an object based on two fields 6 49
rhino JavaScript import, load 25 69
Windows 10 IE Certificate Issue 10 42
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

867 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

23 Experts available now in Live!

Get 1:1 Help Now