what loads proxies?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mklapp

    what loads proxies?

    Hello

    I have a proxy based upon a webservice. The machine.config reports it lacks access to load the proxy. What account name is associated with the attempt to load the Proxy and what permissions (other than the obvious read/execute) does that account need


    mklap

  • Scott Allen

    #2
    Re: what loads proxies?

    If you can post the exact error message you see, that may help narrow
    down the problem.

    --
    Scott


    On Fri, 30 Jan 2004 11:36:09 -0800, mklapp <mklapp@zippy.c om> wrote:
    [color=blue]
    >Hello,
    >
    > I have a proxy based upon a webservice. The machine.config reports it lacks access to load the proxy. What account name is associated with the attempt to load the Proxy and what permissions (other than the obvious read/execute) does that account need?
    >
    >
    >mklapp[/color]

    Comment

    • mklapp

      #3
      Re: what loads proxies?

      I get an Access Denied 401 error

      I am certain I know what the problem is. The proxy file does not grant adequate permissions. What account/user loads the proxy from machine.config?

      Comment

      • Scott Allen

        #4
        Re: what loads proxies?

        401 is an HTTP error message, not something you'd see trying to
        reading a file from the local file system.

        Sounds like the proxy has adequate permissions to start, but when
        making the call runs into a problem. Does the web service you are
        trying to call require authentication?

        --
        Scott


        On Fri, 30 Jan 2004 12:46:04 -0800, mklapp
        <anonymous@disc ussions.microso ft.com> wrote:
        [color=blue]
        >I get an Access Denied 401 error.
        >
        >I am certain I know what the problem is. The proxy file does not grant adequate permissions. What account/user loads the proxy from machine.config?[/color]

        Comment

        • bruce barker

          #5
          Re: what loads proxies?

          the proxy is loading fine, it being denied access to the web service by IIS.
          the requested web service requires authentication credentials be sent and
          you are not supplying them.


          -- bruce (sqlwork.com)


          "mklapp" <anonymous@disc ussions.microso ft.com> wrote in message
          news:BD5A2877-3E1F-46BA-9778-3DF78800A06F@mi crosoft.com...[color=blue]
          > I get an Access Denied 401 error.
          >
          > I am certain I know what the problem is. The proxy file does not grant[/color]
          adequate permissions. What account/user loads the proxy from
          machine.config?


          Comment

          • George Ter-Saakov

            #6
            Re: what loads proxies?

            been there, done that :)

            Anyway after research i findout that standard WebRequest does not support
            Proxy servers.

            So if you have created a wrapper for the webservice you will need to modify
            it.

            Here is an example how i modified the Google Webservice (1 constructor and 1
            overridden method)

            Hope this help.

            public GoogleSearchSer vice()
            {
            this.Url = "http://api.google.com/search/beta2";
            WebProxy objProxy = new WebProxy("10.1. 1.71:80");
            objProxy.Creden tials=new NetworkCredenti al("USERNAME"," PASSWORD");
            this.Proxy = objProxy;
            }
            protected override System.Net.WebR equest GetWebRequest(U ri uri)
            {
            System.Net.Http WebRequest request =
            (System.Net.Htt pWebRequest)bas e.GetWebRequest (uri);
            if (this.PreAuthen ticate)
            {
            System.Net.Netw orkCredential nc =
            this.Credential s.GetCredential (uri,"Basic");
            if (nc != null)
            {
            byte[] credBuf = new
            System.Text.UTF 8Encoding().Get Bytes(nc.UserNa me + ":" + nc.Password);
            request.Headers["Authorizat ion"] = "Basic " +
            Convert.ToBase6 4String(credBuf );
            }
            }
            return request;
            }

            George.


            "mklapp" <mklapp@zippy.c om> wrote in message
            news:6BF36F91-EEEF-4B32-A971-00FF38A2D50F@mi crosoft.com...[color=blue]
            > Hello,
            >
            > I have a proxy based upon a webservice. The machine.config reports it[/color]
            lacks access to load the proxy. What account name is associated with the
            attempt to load the Proxy and what permissions (other than the obvious
            read/execute) does that account need?[color=blue]
            >
            >
            > mklapp
            >[/color]


            Comment

            • Steven Cheng[MSFT]

              #7
              RE: what loads proxies?

              Hi Mklapp,


              Thanks for posting in the community!
              From your description, you encoutered the "Access Denied 401" error when
              calling an ASP.NET webservice's webmethod from a client proxy. Is the full
              error message like:
              "The request failed with HTTP status 401: Access Denied. " ?
              If there is anything I misunderstood, please feel free to let me know.

              Based on my experience, this problem is a security issue with the
              Authentication on ASP.NET web app/web service. Is the Virtual directory of
              the WebService's web application set as Anonymous disabled? If so, since
              when Anonymous access authentication is turned off for the Web service
              application('s virtual directory), all the caller applications must provide
              the credentials before making any request. By default, the Web service
              client proxy does not inherit the credentials of the security context where
              the Web service client application is running.

              To solve the problem , you may try either of the following two methods:
              1. Try change the webservice's virtual directory's Anonymous access as
              allowed. You may follow the below steps:
              -------------------------
              a. In Control Panel, double-click Administrative Tools.
              b. Double-click Internet Information Services.
              c. Expand Internet Information Services, and then locate the WebServiceTest
              virtual directory.
              d. Right-click WebServiceTest, and then click Properties.
              e. Click the Directory Security tab.
              f .Under Anonymous access and authentication control, click Edit.
              g. In the Authentication Methods dialog box, click to select the Anonymous
              access check box.
              --------------------------

              2. To use the Credentials property of the Web service client proxy to set
              the security credentials for Web service client authentication. One way to
              set the credential property is Assign the DefaultCredenti als to the
              Credentials property of the Web Service Proxy class to call the Web service
              while Anonymous access authentication is turned off. The DefaultCredenti als
              property of the CredentialCache class provides system credentials of the
              security context where the application is running. To do this, use the
              following code:

              //myProxy is the instance of a webservice class
              myProxy.Credent ials= System.Net.Cred entialCache.Def aultCredentials ;
              //then call the web method

              Also, all the suggestions above have been discussed in the following KB
              article:
              #PRB: "Access Denied" Error Message When You Call a Web Service While
              Anonymous Authentication Is Turned Off
              Microsoft Support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows 11, Surface, and more.


              Please check out it if you feel anything unclear. Meanwhile, if you have
              any other questions, please feel free to let me know.


              Regards,

              Steven Cheng
              Microsoft Online Support

              Get Secure! www.microsoft.com/security
              (This posting is provided "AS IS", with no warranties, and confers no
              rights.)


              Comment

              • mklapp

                #8
                RE: what loads proxies?

                Hello

                Thanks for your reply. I do have an authentication issue, but it seems to be separate to the issue mentioned here. While perusing the property page of a file, I received a message sometning like

                File permissions are organized incorrectl

                When I clicked one of the buttons, most of the permissions were removed. I knew the file (one of the executables) needed at least one of the permissions removed. I worked that out

                There are still authentication issues to work out and I am doing so

                Thanks again

                mklap

                Comment

                • Mike Moore [MSFT]

                  #9
                  RE: what loads proxies?

                  Hi,

                  David Qiu will work with you in your other thread:
                  Subject: Illegal to mix Authentication methods ?
                  Newsgroup: microsoft.publi c.dotnet.framew ork.aspnet.secu rity

                  Thank you, Mike
                  Microsoft, ASP.NET Support Professional

                  Microsoft highly recommends to all of our customers that they visit the
                  http://www.microsoft.com/protect site and perform the three straightforward
                  steps listed to improve your computer’s security.

                  This posting is provided "AS IS", with no warranties, and confers no rights.

                  Comment

                  • David Qiu

                    #10
                    RE: what loads proxies?

                    When you access the Web service from the WinForm app, I expect you have set
                    the credential property on the proxy.
                    proxy.Credentia ls = myCache

                    [C#]
                    wReq.Credential s = CredentialCache .DefaultCredent ial;
                    [Visual Basic]
                    wReq.Credential s CredentialCache .DefaultCredent ial


                    I don't see you have done the same thing in the ASP.NET Web app. How do you
                    handle the authentication between ASPX and the Web service?
                    Are they on the same machine?

                    Thanks,
                    David
                    Microsoft Developer Support

                    Comment

                    • David Qiu

                      #11
                      RE: what loads proxies?

                      When you access the Web service from the WinForm app, I expect you have set
                      the credential property on the proxy.
                      proxy.Credentia ls = myCache

                      [C#]
                      wReq.Credential s = CredentialCache .DefaultCredent ial;
                      [Visual Basic]
                      wReq.Credential s CredentialCache .DefaultCredent ial


                      I don't see you have done the same thing in the ASP.NET Web app. How do you
                      handle the authentication between ASPX and the Web service?
                      Are they on the same machine?

                      Thanks,
                      David
                      Microsoft Developer Support

                      Comment

                      Working...