Windows login information in java

G

GenxLogic

Hi All,
i want windows login information in my java application.
can anybody help?

Thanks in Advance
Deepak Kumar
 
M

Michael Rauscher

GenxLogic said:
Hi All,
i want windows login information in my java application.
can anybody help?

import java.util.Iterator;
import java.util.Map;

public class Test {
public static final void main( String args[] ) {
for ( Map.Entry<Object,Object> entry :
System.getProperties().entrySet() )
System.out.println(entry.getKey()+": "+entry.getValue());
}
}

Perhaps you'll find the wanted informationen there.

Bye
Michale
 
G

GenxLogic

could you write the logic in proper syntax.
Thanks
Michael said:
GenxLogic said:
Hi All,
i want windows login information in my java application.
can anybody help?

import java.util.Iterator;
import java.util.Map;

public class Test {
public static final void main( String args[] ) {
for ( Map.Entry<Object,Object> entry :
System.getProperties().entrySet() )
System.out.println(entry.getKey()+": "+entry.getValue());
}
}

Perhaps you'll find the wanted informationen there.

Bye
Michale
 
S

Simon

GenxLogic said:
could you write the logic in proper syntax.

That *is* "proper syntax".

If it doesn't compile,
- install Java 1.5
- OR replace the for by an Iterator loop
- OR just use System.out.println(System.getProperties());
 
J

Jeffrey H. Coffield

GenxLogic said:
Hi All,
i want windows login information in my java application.
can anybody help?

Thanks in Advance
Deepak Kumar

private String username = System.getProperty("user.name");
 
J

jamie.eyre

Hi,
The only problem with using this method is that it is possible to
change your USERNAME system property to something else (i.e. admin) via
a command propmt (set USERNAME=admin), and then start the application.
If the application is started in the same command dialog, the
application would then get this new name (i.e. admin), when calling
System.getProperty("user.name");

I also would like to get the windows user name from the client, but i
do not like this method due to the above reason. Does anybody else have
another idea?

Thanks,
Jamie
 
R

Richard Wheeldon

I also would like to get the windows user name from the client, but i
do not like this method due to the above reason. Does anybody else have
another idea?

The jaas framework will return OS-specific login information if
requested - including Windows usernames and domains and Unix user/group
IDs,

Richard
 
G

gimme_this_gimme_that

If you mean Windows Active Directory and you mean you have a Web
Application ...

Google "NTLM Authentification" and JCIFS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top