Home arrow static arrow Java Programming [Archive] - How to retrieve nt user login on a jsp
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - How to retrieve nt user login on a jsp
This topic has 8 replies on 1 page.

Posts:35
Registered: 2/18/02
How to retrieve nt user login on a jsp   
Jul 30, 2004 7:23 AM



 
Hi,

I would like to retrieve the nt login in a jsp.
Is that possible and what is the source code.
i already try something with a header modification, but after it's not possible to POST any information from a form.
Thanks for help

Ibouddha
 

Posts:3,055
Registered: 18/06/98
Re: How to retrieve nt user login on a jsp   
Jul 30, 2004 7:40 AM (reply 1 of 8)



 
1) You need to enable NTLM Authentication in your web container. Alternatives:
- Your web container has a connector to Microsoft IIS, and your pages are served by IIS, not by Tomcat, Apache or another Web Server Examples: IBM WebSphere, Sun iPlanet.
- You can put a servlet filter that does NTLM authentication. Search for it ( www.jcifs.org is a good place for start ).
- If you're using Apache, you can use some module like mod_ntlm or mod_sspi.
2) You need to check what is the attribute of the request that has the desired information. (Try printing all attributes with request.getAttributes() and some looping).
 

Posts:35
Registered: 2/18/02
Re: How to retrieve nt user login on a jsp   
Aug 1, 2004 11:36 PM (reply 2 of 8)



 
Hi,

Probably there is a miss understanding.
I need only to retrieve the nt user login.

I have already a page to log user in the web application.
But i would like to retrieve nt user login to find it in my database, and if it is a valid user, i would like to enter directly in the application. if not to display the login page.
So i don't want to make a ntlm authentification !

I use Apache 1.3.4, Tomcat 3.3.1, and jdk1.4

Thanks for reply.

Ibouddha
 

Posts:8,813
Registered: 10/4/00
Re: How to retrieve nt user login on a jsp   
Aug 2, 2004 12:41 AM (reply 3 of 8)



 
Hi,

Probably there is a miss understanding.

Yes there is. You misunderstood edisonw. He's right.
 

Posts:35
Registered: 2/18/02
Re: How to retrieve nt user login on a jsp   
Aug 2, 2004 12:55 AM (reply 4 of 8)



 
Hi,

I already try to retrieve all the attributes of the request, but there is no parameters posted.
 

Posts:8,813
Registered: 10/4/00
Re: How to retrieve nt user login on a jsp   
Aug 2, 2004 1:04 AM (reply 5 of 8)



 
I know you don't want to authenticate, but it's the only way,
http://www.jguru.com/faq/view.jsp?EID=1045412
 

Posts:35
Registered: 2/18/02
Re: How to retrieve nt user login on a jsp   
Aug 2, 2004 1:09 AM (reply 6 of 8)



 
Hi,

Yes i know but my problem is now that i retrieve the nt user login, but it's impossible to POST any parameters in a form after (lile the post you send in jguru).
 

Posts:35
Registered: 2/18/02
Re: How to retrieve nt user login on a jsp   
Aug 2, 2004 2:32 AM (reply 7 of 8)



 
any ideas ?
 

Posts:3,055
Registered: 18/06/98
Re: How to retrieve nt user login on a jsp   
Aug 2, 2004 6:06 AM (reply 8 of 8)



 
There is the "argh, this is nasty and slow" solution.

If you can't use NTLM authentication, just want to put the NT User login as a parameter, you can write an applet (write a 1-pixel applet to simplify your task), sign it, and use some Javascript to communicate with your applet (search for Netscape LiveConnect). The applet must get the system property "user.name". In my machine System.getProperty("user.name") returns "EDSONW".
 
This topic has 8 replies on 1 page.