getting windows domain login name into java application

Hi,

I am looking how can i get user name of windows logged in user. I want to display the user name in the welcome message of the application. The user will be logging into the domain. Please note that I need windows logged in client user name.

Please give suggestions or any direction on this.

Thanks

[326 byte] By [KirshnaMiriyalaa] at [2007-11-27 3:13:49]
# 1
com.sun.security.auth.module.NTLoginModule
wangwja at 2007-7-12 8:16:19 > top of Java-index,Security,Kerberos & Java GSS (JGSS)...
# 2
Thanks, Wangwj for your response.Could you please give more details on this, like steps, procedure. I looked into this, but not able to figure out the way to do.Thanks a lot in advance.
KirshnaMiriyalaa at 2007-7-12 8:16:19 > top of Java-index,Security,Kerberos & Java GSS (JGSS)...
# 3
http://www.exampledepot.com/egs/javax.security.auth.login/GetLogin.html
wangwja at 2007-7-12 8:16:19 > top of Java-index,Security,Kerberos & Java GSS (JGSS)...
# 4

Thanks a lot for your prompt response.

I tried the example. It works really great from the command prompt.

How do I integrate with application.

My application runs on OC4J server. I hope I need to change the java security.policy file or something to point to my application sepecific policy file (i.e. in the example, the file that we give thru command line).

Not sure.

If possible can you give me some idea on how to change these policy files.

I know I am asking too much, but please help me in this.

Thanks

KirshnaMiriyalaa at 2007-7-12 8:16:19 > top of Java-index,Security,Kerberos & Java GSS (JGSS)...
# 5

Do you mean that JAAS login config file?

I've totally no idea what a OC4J server is, but Googling "OC4J command line options" shows this article. Hope that's what you need.

http://buttso.blogspot.com/2006/11/how-to-set-java-options-for-oc4j.html

Since you may not be able to control what the current directory is, it's better to specify the full path of the config file in the option line.

Good luck!

wangwja at 2007-7-12 8:16:19 > top of Java-index,Security,Kerberos & Java GSS (JGSS)...