• 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

getRemoteUser returns null

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have 4 servlets sitting on a vm and all is well with them. I started rewriting an old servlet in Eclipse that I had started about 5 years ago using a different compiler and request.getRemoteUser() is returning null. I basically just started a new project and cut and pasted the old code into my Eclipse workspace, worked out the compile errors and tried to run it.

I don't think it is a server/tomcat security issue because the other servlets work fine.

Is there some setting in Eclipse that maybe I need to reset or something cryptic that would cause this?
 
Sheriff
Posts: 67746
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
As this is an Eclipse-only issue, it's been moved to the IDEs forum.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
getRemoteUser returns the user ID that the user logged in under. BUT only if that user was authenticated using the J2EE standard container security system.

If the webapp was not deployed in a J2EE security Realm, or if the webapp is using a non-standard security system, the webapp server will not process logins and will not capture and forward the user ID as part of the HttpServletRequest. In which case both getRemoteUser and getUserPrincipal will return null.

Most likely, if the other apps are working, there's an issue with this webapp's deployment context and specifically with its security realm configuration.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I think it's unlikely that Eclipse has anything to do with this.
 
Jan Piper
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm confused. If I open another webapp on this server and log in, I can get in. If I open another, without closing the first one, I'm still logged in. When I open this one, I don't have to log in to get to the application, which is on a secure server, so it has to know who I am to open the page, yet it returns null for remote user.

Any ideas on where I can start looking?
reply
    Bookmark Topic Watch Topic
  • New Topic