• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

storing values in session during authentication

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

I am Implementing Authentication. It does not matter what is the auth-method. It can be BASIC or FORM based. My question, that when the user logins, I want to store his user-id and password in session object. But I am unable to retrieve this userid and password through request.getParameter() or any other method. I am using JDBCRealm to authenticate.

Kindly suggest how do I store these values in session.
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are going with the Container provided authentication(which you have already stated) , I do not think its possible as the authentication code is with the realm and even if you write your own realm then also creation of session at that point might not be possible.
[ July 09, 2007: Message edited by: Rahul Bhattacharjee ]
 
Adrian Perry
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me explain my issue indepth, as to what i am doing

When I am not using Authentication(ie no validation through auth-method), I have a login page, where the user enters his userid and password. This userid and password I authenticate with the entry in the database. When the userid and password is valid one, I store it in session object.

Now if anybody(anonymous user) happens to see my URL and tries to login into the system, using the URL, I try to check his userid and password in session object. In this case they will be null and thus the unauthorized user will be prevented from entering in the system.

This is the reason I wanted to store the userid and password of the authenticated user in session object.

So you can see if I am not using tomcat authentication, I am able to achieve my task. But with tomcat, I still unable to achieve the results that I desire. But I want to implement the authentication using tomcat container, because I want to use SSL.

If there is any other way to implement the above process, I would appreciate if you could share it with me.

Thanks again, for the prompt reply.
 
Adrian Perry
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Is my question so simple such that it does not warrant any attention or is it that it so tough that it does not have any answer.

Expecting an answer to my question is not expecting too much, is it?
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Adrian Perry:
Expecting an answer to my question is not expecting too much, is it?



Please read this.
 
No, tomorrow we rule the world! With this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic