Welcome Guest Search | Active Topics | Sign In | Register

PDF. Windows authentication fails on server. Options
David Harrison
Posted: Thursday, September 3, 2020 9:41:02 AM
Rank: Newbie
Groups: Member

Joined: 8/28/2020
Posts: 5
Hi all,

On a windows 10 PC, I have the following code that will load up a windows authenticated IIS page and successfully create the PDF.

However, the code doesn't work on a windows 2012 R2 IIS?
same authentication set on both IIS's using the same Active directory.


Code
Quote:
EO.Pdf.Runtime.AddLicense(mykey)
EO.Pdf.HtmlToPdf.Options.PageSize = EO.Pdf.PdfPageSizes.A4;
EO.Pdf.HtmlToPdf.ConvertUrl(url, FullPath);



Error
HTTP Error 401.2 - Unauthorized
You are not authorized to view this page due to invalid authentication headers.

any ideas?
Thanks
Dave
David Harrison
Posted: Thursday, September 3, 2020 10:31:45 AM
Rank: Newbie
Groups: Member

Joined: 8/28/2020
Posts: 5
I've gone the ASPXToPDF1.RenderAsPDF(); way instead.
eo_support
Posted: Thursday, September 3, 2020 11:51:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

We have relied your email on 8/28 regarding this issue. ASPXToPDF may resolve ASP.NET Form authentication issue for you because it automatically duplicates Forms authentication cookie. However it does not have that capability for Windows authentication because Windows authentication is not done through cookies.

Thanks!
David Harrison
Posted: Thursday, September 3, 2020 12:16:01 PM
Rank: Newbie
Groups: Member

Joined: 8/28/2020
Posts: 5
thank you, i'm getting somewhere now with the ASPxPDF and this is working on my server.

i'm struggling to find the documentation thou on how to place page breaks in my PDFs (e.g. i'm printing a large html document and i want page breaks at set points).

tia
Dave
eo_support
Posted: Thursday, September 3, 2020 12:47:16 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Kevin H.
Posted: Wednesday, January 13, 2021 4:59:05 PM
Rank: Newbie
Groups: Member

Joined: 1/13/2021
Posts: 1
My solution to 401.2 return with a webforms app was to add the below to the web.config file

<location path="folderPath/pdf_template.aspx">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="true" />
<windowsAuthentication enabled="true">
<providers>
<clear />
<add value="NTLM" />
</providers>
</windowsAuthentication>
</authentication>
</security>
</system.webServer>
</location>

Hope this is useful for someone.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.