Solved

Where/how to rememeber the user is authenticated already in J2ee programmatic security?

Posted on 2006-06-29
1
250 Views
Last Modified: 2013-11-24

I am doing a programmatic security in J2EE.

siteA tries to access my siteB(J2ee) with a token appended in the URL.
In siteB, I verify the token. If it is good, I let him to access the requested page.

My question, where and how do I store the info that he was "authenticated" already? Then, if he accesses another page on siteB, I do not need verify the token anymore.

0
Comment
Question by:workbench
1 Comment
 
LVL 10

Accepted Solution

by:
mukundha_expert earned 250 total points
ID: 17015219
If both siteA and siteB are part of the same application, then you can create session and add the userInfo to the session.

if you are using a token to authenticate in siteB, then you can create a new session in siteB and add the userInfo to that session. so whenever the user tries to access another page in the same site you can use the sessoin information to authenticate him,


Like,

from siteA you are sending a request to siteB with a token in request say user = "jack"

In siteB,

user = request.getParameter("user") ;
session = request.getSession () ;
session.setAttibute ( "user" , user ) ;

In another page of siteB,

user = session.getAttribute ( "user" ) ;
if ( user == null )
   Not autheticated
else
  authenticated
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

680 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