• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

J2EE - Intranet application - Automatically get WINDOWS User Id

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are developing a intranet site based on J2EE techs. The requirement is, as soon as the user logs into intranet application, we should be able to show his/her windows network user id.

For. e.g Assuming, mylibrary is developed in J2EE, as soon as we click http://mylibrary, it should display the logged in windows user id.

Kindly assist.

--venkat
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Venkat,
You have to configure your web application to use integrated windows Authentication. Setting in the IIS and use servlet api to get the user info and display in the web page.

and then try this
<html><body>
<p>
<b>Information about request:</b><br/>
<%

out.println("Auth Type: "+request.getAuthType()+"<br/>");
out.println("Remote User: "+request.getRemoteUser()+"<br/>");
out.println("Requested Session ID: "+request.getRequestedSessionId()
+"<br/>");
out.println("Headers:<br/>");
java.util.Enumeration e = request.getHeaderNames();
while (e.hasMoreElements()) {
String n = (String) e.nextElement();
out.println("   "+n+": "+request.getHeader(n)+"<br/>");
}
%>
</p>
</body></html>
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Venkat, Most of J2EE appservers support SPNEGO feature, which would pass you the client's logon credentials to J2EE application. You should be able to find the necessary configuration document, specific to your appserver.

Good Luck
Chris Paulraj
 
Alas, poor Yorick, he knew this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic