Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

J2EE authentication

Thread view: 
decoy@system102.com - 21 Sep 2006 15:49 GMT
Hi,
 Just a quick question about j2ee...   I have a J2EE system that
allows anybody to create their own client applications to connect
(providing access only to stateless session beans).

What would be the best way to secure this application?  At the moment
when the client logs in they recieve a UserSession object, which
contains information about their connection.  Whenever they then
execute a command they will send this object to the server to ensure
that they are logged in...

My question is how can I be sure that the command being recieved is
coming from the same client who logged in (and not somebody who has
created their own UserSession object with someone elses details).

I hope I made myself clear....

cheers for your help.

SAMPLE CODE:

*******  ****** UserSessionHandler.java

public UserSession login(String username, String password)
{
 //check the db
 if(details correct)
 {
     UserSession session = new UserSession(username);
     //set some more details....
     return session;
 }
 else
     throw new Exception("Invalid credentials");
}

********** ******* ProductSessionObject.java

public Collection getAllProducts(UserSession session)
{
if(isLoggedIn(session))
 //do stuff

}
patros@gmail.com - 22 Sep 2006 19:22 GMT
When the session is first created, have the server generate a
(pseudo)random key and include it as a member variable of the
UserSession object. User passes this object back when it executes a
command, the server can verify the key. I assume you're using
encryption...

> Hi,
>   Just a quick question about j2ee...   I have a J2EE system that
[quoted text clipped - 40 lines]
>
> }


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.