Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. WebService Authorization - The request failed with HTTP status 401: Unauthorized.

WebService Authorization - The request failed with HTTP status 401: Unauthorized.

Scheduled Pinned Locked Moved Web Development
securitycsharpasp-netsql-serversysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BigBlueEye
    wrote on last edited by
    #1

    Hello. Here is my situation. I'm building a client asp.net application that will reside on our DMZ. I have a web service (called "ServiceBus") that acts as a single access point through a single port to our data center. The ServiceBus has methods that do several tasks such as fetching data, running SSRS reports, streaming documents, etc. Everything works fine when testing my client app from within the domain but from the DMZ I get authorization errors (see subject line). The following line of code will get me to the HelloWorld method but any other method that fetches anything from another server fails with permission errors: serviceproxy.Credentials = System.Net.CredentialCache.DefaultCredentials So it seems that I need to send domain user credentials which I try below. I have IIS security set to Digest. The code below was suggested on this post: http://forums.asp.net/p/1050587/1862246.aspx#1862246 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim serviceproxy As New WSBus.ServicesBusWebService() Dim userCredential As NetworkCredential = New NetworkCredential("username", "password", "domain") Dim credentials As CredentialCache = New CredentialCache() credentials.Add(New Uri(serviceproxy.Url), "Digest", userCredential) serviceproxy.Credentials = credentials serviceproxy.PreAuthenticate = True Dim response = serviceproxy.HelloWorld() 'BREAKS HERE lblMessage.Text = response End Sub Any help will be greatly appreciated!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups