This is a migrated thread and some comments may be shown as answers.

The remote server returned an error: (401) Unauthorized

23 Answers 744 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rajendra
Top achievements
Rank 1
Rajendra asked on 15 Nov 2011, 11:02 AM
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

23 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 16 Nov 2011, 01:43 PM
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
0
Matt
Top achievements
Rank 1
answered on 20 Jun 2013, 05:47 PM
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
0
Plamen
Telerik team
answered on 25 Jun 2013, 01:23 PM
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.
0
Matt
Top achievements
Rank 1
answered on 26 Jun 2013, 05:27 PM
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.
0
Plamen
Telerik team
answered on 01 Jul 2013, 10:39 AM
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.
0
Matt
Top achievements
Rank 1
answered on 01 Jul 2013, 03:21 PM
It's on a networked server that uses Windows Server 2003 R2.
0
Plamen
Telerik team
answered on 04 Jul 2013, 02:02 PM
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.
0
Matt
Top achievements
Rank 1
answered on 10 Jul 2013, 07:17 PM
I'm still getting the error after adding that code to my web.config, and the link you gave me didn't help.
0
Boyan Dimitrov
Telerik team
answered on 15 Jul 2013, 02:11 PM
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.
0
Matt
Top achievements
Rank 1
answered on 23 Jul 2013, 07:16 PM
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>
0
Matt
Top achievements
Rank 1
answered on 24 Jul 2013, 06:26 PM
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.
0
Plamen
Telerik team
answered on 26 Jul 2013, 08:42 AM
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.
0
Matt
Top achievements
Rank 1
answered on 29 Jul 2013, 09:24 PM
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?
0
Matt
Top achievements
Rank 1
answered on 30 Jul 2013, 06:18 PM
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?
0
Plamen
Telerik team
answered on 01 Aug 2013, 01:45 PM
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.
0
Matt
Top achievements
Rank 1
answered on 12 Aug 2013, 09:14 PM
We moved the project to a server running 2008 R2 and now ExportToPDF() works. Maybe it's something to do with 2003 R2?
0
Plamen
Telerik team
answered on 16 Aug 2013, 04:57 AM
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.
0
Chris
Top achievements
Rank 1
answered on 21 Mar 2016, 06:42 PM

Was a resolution ever found for this?  We are experiencing the same problem.  It runs locally but if you try remotely it does not.  We are running on Windows Server 2012 R2 with Windows authentication and impersonation.

 

What folder permissions and permission types are required by your control to successfully export to PDF?

0
Chris
Top achievements
Rank 1
answered on 21 Mar 2016, 06:43 PM
I should also add that we are running the newest controls via your control panel.
0
Plamen
Telerik team
answered on 24 Mar 2016, 12:09 PM
Hi,

Unfortunately we were still not able to replicate the issue at our side. Yet the issue is logger for deeper investigation. If you are able to replicate the issue with the SchedulerPDF.zip project attached in this thread locally please let us know what are the exact settings to observe it locally.

Regards,
Plamen
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
PW
Top achievements
Rank 1
answered on 01 Aug 2016, 03:55 PM
I am having the exact same problem.  Server 2008 R2, remote. Cannot export PDF from schedule.
0
Chris
Top achievements
Rank 1
answered on 01 Aug 2016, 04:20 PM

After a couple painstaking weeks.  It turned out to be a permission problem caused by network routing.  We finally figured out that the export process was sending a request to itself during the export process.  It was not staying within our intranet when it did.  This was preventing the process from impersonating the user during the export.  It would work with the fully qualified server name, but it would not work with the DNS for our intranet server.  We had to update an internal a name record that allowed the server accept requests internally on our intranet.  This retained the impersonation that was needed to authorize the user to resources on the server.  It now works for us.

 

Your issue may be different from ours, and I don't know if this will help but hopefully it will put you on to a possible solution that you may have been overlooking.

Regards,

Chris

0
PW
Top achievements
Rank 1
answered on 01 Aug 2016, 05:35 PM
thanks for the tip Chris.  we have a fqdn for the intranet server, but I'm not sure how to check if it's passing the export request to a different URL.  I will look into this too.
Tags
Scheduler
Asked by
Rajendra
Top achievements
Rank 1
Answers by
Simon
Telerik team
Matt
Top achievements
Rank 1
Plamen
Telerik team
Boyan Dimitrov
Telerik team
Chris
Top achievements
Rank 1
PW
Top achievements
Rank 1
Share this question
or