• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Httpservlet ecurity methods

 
vitesse wei
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is different between getUserPrincipal() and getRemoteUser(),only different is what they returned?I see the JavaDoc,it's said
a String specifying the login of the user making this request, or null if the user login is not known

what is "the login" mean,what String value we will have if user is fail/pass on authentication?
thanks.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you mean HttpServletRequest.

"the login" means the user name.

If authentication fails? If authentication fails, the user doesn't get in. If the user doesn't get in, there's no code to run that would ask for the user name.

If, however, the user is in an area that doesn't require authentication, there can be code that looks for the user name. It won't find anything though. Both methods will return null, just as the API says.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic