I always have a question no one can answer

Discussion in 'ASP .Net' started by Rotsey, Jun 26, 2006.

  1. Rotsey

    Rotsey Guest

    I have created a ASP.NET 2.0 websevrice on a server and I want to secure it
    with Windows authentication

    The web service is in a Vritual Directory.

    I have add a Windows user to the server.
    I have set the security to Integrated Windows Authentication and removed
    anonymous access
    I have set Perimissons on the folder for full control to the web service
    folder.

    I am accessing the service in a win forms app
    This is code I am using

    Dim mycredentialCache As CredentialCache = New CredentialCache()

    ' Create a new instance of NetworkCredential using the client

    ' credentials.

    Dim credentials As NetworkCredential = New _

    NetworkCredential("user", "password", "")

    ' Add the NetworkCredential to the CredentialCache.

    mycredentialCache.Add(New Uri(tWeb.Url), "Basic", _

    credentials)

    ' Add the CredentialCache to the proxy class credentials.

    tWeb.Credentials = mycredentialCache

    ds = tWeb.GetData(lstTables.SelectedItem.ToString, txtCount.Text,
    txtSort.Text, txtWhere.Text)

    But I get HTTP 401 Unauthorized message.

    Any ideas???
    Rotsey, Jun 26, 2006
    #1
    1. Advertising

  2. > I have set the security to Integrated Windows Authentication and removed
    > anonymous access
    >
    > mycredentialCache.Add(New Uri(tWeb.Url), "Basic", _
    > credentials)


    If you are using IWA and not basic authentication then you can't use basic
    authentication from your code.

    Try this:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;813834
    =?Utf-8?B?TGVvbiBNYXluZQ==?=, Jun 26, 2006
    #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. Jay
    Replies:
    7
    Views:
    416
  2. hugo
    Replies:
    1
    Views:
    358
    Ali Cehreli
    Aug 17, 2004
  3. Replies:
    1
    Views:
    379
    Peter Flynn
    Feb 18, 2007
  4. .NET Follower
    Replies:
    0
    Views:
    121
    .NET Follower
    Feb 9, 2004
  5. Charles Taylor
    Replies:
    0
    Views:
    123
    Charles Taylor
    Oct 24, 2005
Loading...

Share This Page