• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get user ID information - not in the Principal or remote user

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to duplicate/replace a Perl module which is getting the user ID information (I think) from some CGI information which is not available to my servlet via request.getRemoteUser() or request.getPrincipal().getName(). I can look at all of the request paramaeters as well as all request and session attributes and this user ID info is not present. However the Perl module can find it using the following code:

my $r = shift;
my($user_id) = $r->connection->user;

It looks as if there is information available to the Perl module (in the $r->connection object, some CGI variables perhaps ?) which I am yet unable to access from my servlet. Is anyone aware of how I might get this info ?

Thanks in advance for any assistance or insight.


-James
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by James Adams:
I need to duplicate/replace a Perl module which is getting the user ID information (I think) from some CGI information which is not available to my servlet via request.getRemoteUser() or request.getPrincipal().getName(). I can look at all of the request paramaeters as well as all request and session attributes and this user ID info is not present. However the Perl module can find it using the following code:

my $r = shift;
my($user_id) = $r->connection->user;

It looks as if there is information available to the Perl module (in the $r->connection object, some CGI variables perhaps ?) which I am yet unable to access from my servlet. Is anyone aware of how I might get this info ?

Thanks in advance for any assistance or insight.


-James

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can get the user information using:
request.getRemoteUser();

look at the javadocs for HttpServletRequest.
There are a lot of methods that might help.

( request.getUserPrincipal() is also available )

Good Luck!
 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first step is really to determine what that user ID represent.

Username? Password? IP? session ID, etc.?

request.getRemoteUser() works only when basic or digest authentication is used.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic