Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2006-06-29
1
249 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

856 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