Network Authentication

Discussion in 'Java' started by Marco Roda, Oct 5, 2005.

  1. Marco Roda

    Marco Roda Guest

    Hi,

    I need to access a network resource that requires authentication
    (user/password): typically when I access through Windows Explore the network
    shared folder:
    \\<server>\<shared_folder>
    I am required to supply username and password.
    How to implement it in Java code and supply the information required?

    Thank you,
    Marco
     
    Marco Roda, Oct 5, 2005
    #1
    1. Advertising

  2. You might want to try executing (Runtime.exec ) a command like this -

    "net use \\server\shared-folder password /USER:username " before
    trying to access any files on this folder.
    So if the server name is "myserver.mycomp.com" , shared folder name is
    "net-share", user name is "marco" and password is "marco123", this
    command will look like -
    net use \\myserver.mycomp.com\net-share marco123 /USER:marco

    Note that this will make "net-share" accessible on the computer to other
    processes as well and any user working on the computer will be able to
    get to this share without providing user id and password.

    Are you sure that you need to access your files this way though? What
    about using some other network protocols for accessing this network
    resource ?

    Abhijat


    Marco Roda wrote:
    > Hi,
    >
    > I need to access a network resource that requires authentication
    > (user/password): typically when I access through Windows Explore the network
    > shared folder:
    > \\<server>\<shared_folder>
    > I am required to supply username and password.
    > How to implement it in Java code and supply the information required?
    >
    > Thank you,
    > Marco
    >
    >
     
    Abhijat Vatsyayan, Oct 5, 2005
    #2
    1. Advertising

  3. Marco Roda

    Marco Roda Guest

    Thank you,

    That should work, but I think it is not the right way, as you said.
    Currently I am trying using Perl NetResource module...
    Marco

    "Abhijat Vatsyayan" <> wrote in message
    news:wcM0f.7881$...
    > You might want to try executing (Runtime.exec ) a command like this -
    >
    > "net use \\server\shared-folder password /USER:username " before
    > trying to access any files on this folder.
    > So if the server name is "myserver.mycomp.com" , shared folder name is
    > "net-share", user name is "marco" and password is "marco123", this
    > command will look like -
    > net use \\myserver.mycomp.com\net-share marco123 /USER:marco
    >
    > Note that this will make "net-share" accessible on the computer to other
    > processes as well and any user working on the computer will be able to
    > get to this share without providing user id and password.
    >
    > Are you sure that you need to access your files this way though? What
    > about using some other network protocols for accessing this network
    > resource ?
    >
    > Abhijat
    >
    >
    > Marco Roda wrote:
    > > Hi,
    > >
    > > I need to access a network resource that requires authentication
    > > (user/password): typically when I access through Windows Explore the

    network
    > > shared folder:
    > > \\<server>\<shared_folder>
    > > I am required to supply username and password.
    > > How to implement it in Java code and supply the information required?
    > >
    > > Thank you,
    > > Marco
    > >
    > >
     
    Marco Roda, Oct 5, 2005
    #3
  4. Marco Roda

    Rogan Dawes Guest

    Marco Roda wrote:
    > Hi,
    >
    > I need to access a network resource that requires authentication
    > (user/password): typically when I access through Windows Explore the network
    > shared folder:
    > \\<server>\<shared_folder>
    > I am required to supply username and password.
    > How to implement it in Java code and supply the information required?
    >
    > Thank you,
    > Marco
    >
    >


    This is a very vague request, but if I understand what you are asking
    correctly, you may be able to achieve what you are after using jcifs.

    Google for it.

    Rogan
     
    Rogan Dawes, Oct 5, 2005
    #4
  5. Manfred Rosenboom, Oct 6, 2005
    #5
  6. Marco Roda

    Roedy Green Guest

    Roedy Green, Oct 7, 2005
    #6
    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. Kal
    Replies:
    1
    Views:
    9,528
    Kevin Spencer
    Jun 21, 2004
  2. Jane Davis

    Network Service account over network

    Jane Davis, Jun 22, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    451
    Kevin Spencer
    Jun 22, 2005
  3. Bill Volk
    Replies:
    1
    Views:
    3,154
    Bill Volk
    Jul 2, 2003
  4. kin
    Replies:
    0
    Views:
    918
  5. king
    Replies:
    1
    Views:
    282
Loading...

Share This Page