WebService Authentication

Discussion in 'ASP .Net Web Services' started by mail747097@fificorp.net, Apr 25, 2007.

  1. Guest

    I'm trying to call a web service with a different user than the one I
    have logged in with. I'm using the web server built into VS.NET 2005.

    I have the following code to call the web service using a proxy class:
    MyWebService webService = new MyWebService.MyClass();
    webService.Credentials = new NetworkCredential("MyDomain\
    \SomeOneElse", "HisPassword");
    webService.UseDefaultCredentials = false;
    webService.HelloWorld();

    However if I in the web service HelloWorld() function check
    User.Identity.Name I am stil getting "MyDomain\\Me" and not "MyDomain\
    \SomeOneElse".
     
    , Apr 25, 2007
    #1
    1. Advertising

  2. ganesh Guest

    Please get clue from following questions.
    Do the other users have access to the web service?
    See the security permissions for the web service directory?
    Is that user in the network and have access to the web server?



    "" wrote:

    > I'm trying to call a web service with a different user than the one I
    > have logged in with. I'm using the web server built into VS.NET 2005.
    >
    > I have the following code to call the web service using a proxy class:
    > MyWebService webService = new MyWebService.MyClass();
    > webService.Credentials = new NetworkCredential("MyDomain\
    > \SomeOneElse", "HisPassword");
    > webService.UseDefaultCredentials = false;
    > webService.HelloWorld();
    >
    > However if I in the web service HelloWorld() function check
    > User.Identity.Name I am stil getting "MyDomain\\Me" and not "MyDomain\
    > \SomeOneElse".
    >
    >
     
    ganesh, May 9, 2007
    #2
    1. Advertising

  3. Guest

    On 9 Maj, 07:48, ganesh <> wrote:
    > Please get clue from following questions.
    > Do the other users have access to the web service?
    > See the security permissions for the web service directory?
    > Is that user in the network and have access to the web server?
    >
    >
    >
    > "" wrote:
    > > I'm trying to call a web service with a different user than the one I
    > > have logged in with. I'm using the web server built into VS.NET 2005.

    >
    > > I have the following code to call the web service using a proxy class:
    > > MyWebService webService = new MyWebService.MyClass();
    > > webService.Credentials = new NetworkCredential("MyDomain\
    > > \SomeOneElse", "HisPassword");
    > > webService.UseDefaultCredentials = false;
    > > webService.HelloWorld();

    >
    > > However if I in the web service HelloWorld() function check
    > > User.Identity.Name I am stil getting "MyDomain\\Me" and not "MyDomain\
    > > \SomeOneElse".- Dölj citerad text -

    >
    > - Visa citerad text -


    My other post contains more information:

    I'm trying to access a web service with another user running under
    the
    built in web server in VS.NET 2005. I have the following code to
    access the web service:

    MyWebService webService = new MyWebService.MyClass();
    webService.Credentials = new NetworkCredential("MyDomain\
    \SomeoneElse", "HisPassword");
    webService.UseDefaultCredentials = false;
    webService.HelloWorld();


    However if I check User.Identity.Name in the web service I get
    "MyDomain\\Me" insead of "MyDomain\\SomeoneElse".


    I would like to use this to only allow "MyDomain\\SomeoneElse" to
    access the web service so I have the following in web.config:


    <authentication mode="Windows"/>
    <authorization>
    <allow users="MyDomain\SomeoneElse"/>
    <allow users="MyDomain\Me"/>
    <deny users="*"/>
    </authorization>


    Where "MyDomain\Me" is only for this test.

    Your questions:
    Do the other users have access to the web service? - See
    <authorization> above.
    See the security permissions for the web service directory? - See
    <authorization> above.
    Is that user in the network and have access to the web server? - All
    users are in ActiveDirectory and members of the domain.

    I have discovered now that this only is a problem with the web server
    built into VS.NET 2005 and that it works in IIS.
     
    , May 11, 2007
    #3
    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. batista
    Replies:
    1
    Views:
    922
    Laurent Bugnion
    Jan 26, 2006
  2. batista
    Replies:
    0
    Views:
    567
    batista
    Jan 26, 2006
  3. Mr. x
    Replies:
    2
    Views:
    718
    Andrew
    Oct 10, 2003
  4. Cyril
    Replies:
    2
    Views:
    4,509
    Cyril
    Jun 1, 2006
  5. Mr. x

    use another webservice in a webservice

    Mr. x, Sep 26, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    143
    Mr. x
    Sep 26, 2003
Loading...

Share This Page