Andrea Girardi
Andrea Girardi

Reputation: 4427

Get logon user information on J2EE application

I'm working with J2EE application and my web application has to recognize the user without authenticate using the windows logon user info.

When I create a web applciation with VB.NET I used something like that:

Session("Login") = Mid(Request.ServerVariables("LOGON_USER"), Request.ServerVariables("LOGON_USER").IndexOf("\") + 2)

Do you know if it's possible to do the same on Java / Spring / Tomcat webapplication?

tnx,
Andrea

Upvotes: 0

Views: 1713

Answers (1)

Jack Edmonds
Jack Edmonds

Reputation: 33171

You can use HttpServletRequest.getRemoteUser().

Note that you will need to add some sort of authentication to Tomcat. For example, if you are trying to do NTLM authentication, you can use Waffle.

Upvotes: 1

Related Questions