WebService Credentials

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

  1. Guest

    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.
     
    , Apr 25, 2007
    #1
    1. Advertising

  2. Guest

    It took a day for this post to show up so that is why there are two of
    them.
     
    , Apr 26, 2007
    #2
    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. Replies:
    2
    Views:
    12,322
    Bruce Barker
    Nov 18, 2005
  2. ad
    Replies:
    1
    Views:
    1,069
    Matt Dunn
    Mar 18, 2006
  3. Nenad
    Replies:
    2
    Views:
    8,049
    Tor Iver Wilhelmsen
    Jul 14, 2004
  4. Steve B.

    WebService Credentials

    Steve B., Jun 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    5,985
    Adnan77
    Sep 11, 2006
  5. Jay Balapa
    Replies:
    2
    Views:
    595
    =?Utf-8?B?TWFyYyBWZXJkaQ==?=
    Jun 26, 2006
Loading...

Share This Page