Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

Windows login information in java

Thread view: 
GenxLogic - 31 Jul 2006 08:53 GMT
Hi All,
      i want windows login information in my java application.
can anybody help?

Thanks in Advance
Deepak Kumar
Michael Rauscher - 31 Jul 2006 09:20 GMT
GenxLogic schrieb:
> 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
GenxLogic - 31 Jul 2006 11:05 GMT
could you write the logic in proper syntax.
Thanks
> GenxLogic schrieb:
> > Hi All,
[quoted text clipped - 16 lines]
> Bye
> Michale
Simon - 31 Jul 2006 11:16 GMT
GenxLogic schrieb:
> 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());
Simon - 31 Jul 2006 11:17 GMT
> - OR replace the for by an Iterator loop

(after removing everything in between "<" and ">")
Jeffrey H. Coffield - 31 Jul 2006 14:55 GMT
> 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");
jamie.eyre@gmail.com - 22 Aug 2006 17:17 GMT
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

> > Hi All,
> >        i want windows login information in my java application.
[quoted text clipped - 4 lines]
>
> private String username = System.getProperty("user.name");
Richard Wheeldon - 28 Aug 2006 19:39 GMT
> 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
gimme_this_gimme_that@yahoo.com - 28 Aug 2006 21:33 GMT
If you mean Windows Active Directory and you mean you have a Web
Application ...

Google "NTLM Authentification" and JCIFS.

> Hi All,
>        i want windows login information in my java application.
> can anybody help?
>
> Thanks in Advance
> Deepak Kumar


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.