The remote server returned an error: (401) Unauthorized

18 posts, 0 answers
  1. Rajendra
    Rajendra avatar
    1 posts
    Member since:
    Mar 2011

    Posted 15 Nov 2011 Link to this post

    Hello,

    while trying to output the details using RadSchedular control to export to PDF"  getting follwing error.

    The remote server returned an error: (401) Unauthorized.]
       System.Net.HttpWebRequest.GetResponse() +5376077
       Telerik.Web.UI.Scheduler.SchedulerExporter.GetStyleSheet(String url) +76
       Telerik.Web.UI.Scheduler.SchedulerExporter.RenderControl(Page page) +254
       Telerik.Web.UI.Scheduler.SchedulerExporter.PdfExportRenderForm(HtmlTextWriter nullWriter, Control form) +55
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +8679961
       System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
       System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
       Telerik.Web.UI.Scheduler.SchedulerExporter.PdfExportRenderPage(HtmlTextWriter nullWriter, Control page) +108
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Page.Render(HtmlTextWriter writer) +29
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

    currently we are using the NTLM security on web application then error is occuring.
    when we changed the security level to anonymous able to open the PDF document.

    Request to assistance on the above issue to workout with NTLM secutity.

    Thanks
    Rajendra.k

  2. Simon
    Admin
    Simon avatar
    2281 posts
    Member since:
    Sep 2012

    Posted 16 Nov 2011 Link to this post

    Hello Rajendra,

    We fixed the 'The remote server returned an error: (401) Unauthorized.' error for the Q3 2011 release, which is about the go live after few hours. Please download the new bits, test them on your side and let me know how it goes.

    Best wishes,
    Simon
    the Telerik team

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

  3. DevCraft Release
  4. Matt
    Matt avatar
    24 posts
    Member since:
    Dec 2012

    Posted 20 Jun 2013 Link to this post

    Hello,

    I'm using the Q1 2013 ASP.NET AJAX controls and I'm getting this error when using the ExportToPDF() function.

    Any ideas?

    Thanks,
    Matt

  5. Plamen
    Admin
    Plamen avatar
    2276 posts
    Member since:
    Jul 2012

    Posted 25 Jun 2013 Link to this post

    Hi Matt,

     
    We are not aware of what may be causing such error with the latest version of RadControls. Would you please let us know if your sample is some how different from the one on our online demo and if it happens locally or when you host it on the server?

    If you notice any other differences please share them as well.

    Regards,
    Plamen
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.

  6. Matt
    Matt avatar
    24 posts
    Member since:
    Dec 2012

    Posted 26 Jun 2013 Link to this post

    Yeah, there's nothing fancy about it, it's just a RadScheduler with a RadButton that when clicked executes ExportToPDF(). On my local machine it works fine but when I move it to a remote server it throws the error.

  7. Plamen
    Admin
    Plamen avatar
    2276 posts
    Member since:
    Jul 2012

    Posted 01 Jul 2013 Link to this post

    Hi Matt,

     
    Would you please provide a bit information about the server you are using so we could test the exact scenario locally and try to research the issue deeper?

    Regards,
    Plamen
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.

  8. Matt
    Matt avatar
    24 posts
    Member since:
    Dec 2012

    Posted 01 Jul 2013 Link to this post

    It's on a networked server that uses Windows Server 2003 R2.

  9. Plamen
    Admin
    Plamen avatar
    2276 posts
    Member since:
    Jul 2012

    Posted 04 Jul 2013 Link to this post

    Hello,

     
    Would you please try setting the following setting in your web config and let us know if it is working properly this time:

    <configuration>
    ...
    <location path="Telerik.Web.UI.WebResource.axd">
       <system.web>
         <authorization>
           <allow users="*"/>
         </authorization>
       </system.web>
     </location>
    ...
    </configuration>

    You can also review this help topic where  more information about possible issues in PDFExport is provided.

    Hope this will be helpful.
    Regards,
    Plamen
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.

  10. Matt
    Matt avatar
    24 posts
    Member since:
    Dec 2012

    Posted 10 Jul 2013 Link to this post

    I'm still getting the error after adding that code to my web.config, and the link you gave me didn't help.

  11. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    927 posts
    Member since:
    Aug 2012

    Posted 15 Jul 2013 Link to this post

    Hello,


    In order to avoid any further confusions I am attaching a sample web site project containing RadScheduler and RadButton control to export the RadScheduler to PDF file and it works as expected at our side. Could you please try to move that project to your server and test whether it is working and exports it successfully?


    Regards,
    Boyan Dimitrov
    Telerik

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.

  12. Matt
    Matt avatar
    24 posts
    Member since:
    Dec 2012

    Posted 23 Jul 2013 Link to this post

    I downloaded your project and changed it to .NET framework 3.5 (since that's the highest version the remote server runs) and it worked fine on my machine. When moved to the remote server I get the same "Unauthorized" error.

    Here is my web.config in case it will help:

    <?xml version="1.0"?>
    <configuration>
      <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
            <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
              <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
              <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
              <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
              <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
            </sectionGroup>
          </sectionGroup>
        </sectionGroup>
      </configSections>
      <connectionStrings>
        // Connection strings.
      </connectionStrings>
      <appSettings>
        <add key="Telerik.Skin" value="Office2007"/>
        <add key="Telerik.ScriptManager.TelerikCdn" value="Disabled"/>
        <add key="Telerik.StyleSheetManager.TelerikCdn" value="Disabled"/>
      </appSettings>
      <system.web>
        <authentication mode="Windows"/>
        <identity impersonate="true"/>
        <anonymousIdentification enabled="false"/>
        <authorization>
            <allow users="*"/>
        </authorization>
        <compilation debug="true">
          <assemblies>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
          </assemblies>
        </compilation>
        <pages>
          <controls>
            <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
            <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </controls>
        </pages>
        <httpHandlers>
          <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>
          <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
          <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
          <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>
          <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
          <remove verb="*" path="*.asmx"/>
          <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </httpHandlers>
        <httpModules>
          <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/>
          <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
          <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </httpModules>
        <customErrors mode="Off"/>
      </system.web>
      <location path="Telerik.Web.UI.WebResource.axd">
        <system.web>
          <authorization>
            <allow users="*"/>
          </authorization>
        </system.web>
      </location>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true">
          <remove name="ScriptModule"/>
          <remove name="RadUploadModule"/>
          <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode"/>
          <remove name="RadCompression"/>
          <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode"/>
          <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </modules>
        <handlers>
          <remove name="WebServiceHandlerFactory-Integrated"/>
          <remove name="ScriptHandlerFactory"/>
          <remove name="ScriptHandlerFactoryAppServices"/>
          <remove name="ScriptResource"/>
          <remove name="ChartImage_axd"/>
          <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode"/>
          <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/>
          <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/>
          <remove name="Telerik_Web_UI_DialogHandler_aspx"/>
          <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/>
          <remove name="Telerik_RadUploadProgressHandler_ashx"/>
          <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode"/>
          <remove name="Telerik_Web_UI_WebResource_axd"/>
          <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode"/>
          <add name="Telerik.Web.UI.WebResource"  path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=3.5.0.0, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
          <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </handlers>
      </system.webServer>
      <system.codedom>
          <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
              <providerOption name="CompilerVersion" value="v3.5"/>
              <providerOption name="WarnAsError" value="false"/>
          </compiler>
        </compilers>
      </system.codedom>
      <runtime>
        <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>

  13. Matt
    Matt avatar
    24 posts
    Member since:
    Dec 2012

    Posted 24 Jul 2013 Link to this post

    I even tried using the newest 2013.2.717.35 dlls and I still get the same error. I then checked to see if maybe NETWORK SERVICE didn't have the proper permissions by switching the app pool to use LOCAL SYSTEM for permissions and that didn't work either.

  14. Plamen
    Admin
    Plamen avatar
    2276 posts
    Member since:
    Jul 2012

    Posted 26 Jul 2013 Link to this post

    Hi,

     We have performed lots of tests with the same project on different servers but unfortunately could not replicate the same error. It looks like a specific issue that may be caused by some setting of the specific server.  Is it possible for you to test if you observe the same error on different server?

    Regards,
    Plamen
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.

  15. Matt
    Matt avatar
    24 posts
    Member since:
    Dec 2012

    Posted 29 Jul 2013 Link to this post

    I hosted it on another server and it worked fine... ugh... are there any settings that we should especially look into that would be preventing it from working on the original server?

  16. Matt
    Matt avatar
    24 posts
    Member since:
    Dec 2012

    Posted 30 Jul 2013 Link to this post

    Nevermind, I found that it was only working because I was accessing the website from the server it was being hosted on.

    I did run across this however: http://msdn.microsoft.com/en-us/library/ms998355.aspx

    I use Windows authentication and the web application is running on ASP 2.0 on a Windows Server 2003 server. Would the problem that that link highlights have anything to do with it?

  17. Plamen
    Admin
    Plamen avatar
    2276 posts
    Member since:
    Jul 2012

    Posted 01 Aug 2013 Link to this post

    Hi,

    We have inspected the article that you shared but there is no a know issue in RadScheduler that is similar to the one in it. In case when Authentication is used there should be no problem when the appropriate setting that we have already shared in this thread are set properly in the configuration file.

    Regards,
    Plamen
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.

  18. Matt
    Matt avatar
    24 posts
    Member since:
    Dec 2012

    Posted 12 Aug 2013 Link to this post

    We moved the project to a server running 2008 R2 and now ExportToPDF() works. Maybe it's something to do with 2003 R2?

  19. Plamen
    Admin
    Plamen avatar
    2276 posts
    Member since:
    Jul 2012

    Posted 15 Aug 2013 Link to this post

    Hi,

     
    We have tested the issue described but could unfortunately could not observe the unusual behavior. I have logged it for further investigation by our developers.

    Regards,
    Plamen
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.

Back to Top
DevCraft Release