Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
James Adams
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • 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
 
Jason Milliron
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • 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
 
Moody Hopkins
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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!
 
Brahim Bakayoko
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic