0

I need to acess the name of the user of the Proxy, our server is Jboss6.4, when this user enter in my URL, I'm using ServletRequestListener, with the object HttpServletRequest, but I can't find the user.

String user1= request.getUserPrincipal().getName();

String user2 = request.getRemoteUser();

Both's are null, I need to do authentication without use a typical modal window or formular, I want to do this automatic, my idea it's use the LogonId of the User that he use in the Proxyof the browser and afterwards check in my LDAP directory if exist and the rights are correct.

To acess to the URL, the user first has to login in the browser because we have a proxy, my idea is take the id of the user from the proxy, but Ican't find it..

reizintolo
  • 429
  • 2
  • 7
  • 20

1 Answers1

0

Unless your proxy is setting a header containing the username in the forwarded HTTP requests, you won't have the ability to retrieve the username used to connect to the proxy.

What you want to achieve looks like SSO but a simple proxy won't achieve SSO.

Gaël J
  • 11,274
  • 4
  • 17
  • 32
  • Gaël, ok, We have something like this in C# App with this : WindowsIdentity.GetCurrent() we get the current user, but in this project is in jee6, but we are working with windows and explorer, can we do something?? a SSo it's not possible by the moment – reizintolo Jan 29 '16 at 08:59
  • Do you mean, using Windows authentication would work for you ? if so look at http://stackoverflow.com/questions/9773688/windows-authentication-for-java-based-web-applications-how-to and http://stackoverflow.com/questions/4751157/integrated-windows-authentication-ntlm-in-a-java-weblogic-app – Gaël J Jan 29 '16 at 09:12
  • I think this fix the problem: https://github.com/dblock/waffle/ do you know this library? in localhost works, I'm not sure if this works in our server..? – reizintolo Jan 29 '16 at 10:48