Windows login information in java

Discussion in 'Java' started by GenxLogic, Jul 31, 2006.

  1. GenxLogic

    GenxLogic Guest

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

    Thanks in Advance
    Deepak Kumar
     
    GenxLogic, Jul 31, 2006
    #1
    1. Advertising

  2. 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
     
    Michael Rauscher, Jul 31, 2006
    #2
    1. Advertising

  3. GenxLogic

    GenxLogic Guest

    could you write the logic in proper syntax.
    Thanks
    Michael Rauscher wrote:
    > 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, Jul 31, 2006
    #3
  4. GenxLogic

    Simon Guest

    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, Jul 31, 2006
    #4
  5. GenxLogic

    Simon Guest

    Simon wrote:

    > - OR replace the for by an Iterator loop


    (after removing everything in between "<" and ">")
     
    Simon, Jul 31, 2006
    #5
  6. GenxLogic wrote:
    > 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");
     
    Jeffrey H. Coffield, Jul 31, 2006
    #6
  7. GenxLogic

    Guest

    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

    Jeffrey H. Coffield wrote:
    > GenxLogic wrote:
    > > 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");
     
    , Aug 22, 2006
    #7
  8. wrote:
    > 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
     
    Richard Wheeldon, Aug 28, 2006
    #8
  9. GenxLogic

    Guest

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

    Google "NTLM Authentification" and JCIFS.


    GenxLogic wrote:
    > Hi All,
    > i want windows login information in my java application.
    > can anybody help?
    >
    > Thanks in Advance
    > Deepak Kumar
     
    , Aug 28, 2006
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. z. f.
    Replies:
    0
    Views:
    714
    z. f.
    Feb 3, 2005
  2. subrato
    Replies:
    8
    Views:
    939
    Juan T. Llibre
    Mar 14, 2006
  3. clercmedia
    Replies:
    2
    Views:
    32,469
    clercmedia
    Dec 9, 2005
  4. Replies:
    5
    Views:
    8,549
    Chris Uppal
    Aug 23, 2006
  5. Venu Vinod N

    Windows Login Information

    Venu Vinod N, Oct 30, 2003, in forum: Javascript
    Replies:
    1
    Views:
    180
    Randell D.
    Oct 30, 2003
Loading...

Share This Page