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

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.
 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic