1

I am using EVOPdf converter in my MVC4 project.

I am using the method pdfConverter.GetPdfBytesFromUrl to hit another controller action to return the rendered HTML and have that get converted into a PDF.

My problem is that I now have an [Authorize] attribute on the controller, now that same method only renders a log-in page.

Since I'm requesting the URL from within the same controller (but a different actionresult), is there any way to pass authentication?

  string myOwnAddress = System.Configuration.ConfigurationManager.AppSettings["local-address"];

        //THIS WILL NEED THE PARAMETERS SENT VIA THE GET URL
        byte[] pdfBytes =
            pdfConverter.GetPdfBytesFromUrl(myOwnAddress + "/ClinicianReportPDFRendered?PID=" + PID);
Scottingham
  • 906
  • 2
  • 11
  • 26

1 Answers1

0

Unless somebody can come up with a better solution, I'm going to create a unique key in the requesting action to be passed/used one time and authenticate using that code in the other action.

The only downside is I'll have to take off the blanket [Authorize] on the top of the controller and apply it individually to each action result.

Scottingham
  • 906
  • 2
  • 11
  • 26