11
Views
2
Comments
[Ultimate PDF] How to use UltimatePDF with MSFT SSO implemented
Ultimate PDF
Forge asset by OutSystems Labs
Application Type
Traditional Web, Reactive

Hi everyone,

I’m currently facing an issue while using UltimatePDF to generate a PDF for my report. I have integrated Microsoft Authentication (Azure AD SSO) which I downloaded from the Forge.

The problem is that whenever I click the Print button, instead of displaying or downloading the actual report page that I designed, it shows the login page in the PDF.

Has anyone knows how to make UltimatePDF work correctly with Microsoft Authentication enabled?

Here’s a summary of my setup for context:

  • Using Microsoft Authentication component from Forge

  • Authentication flow works fine when browsing normally

  • The generated PDF shows the login screen instead of the report

Any guidance or example on how to properly configure this would be greatly appreciated!

Thanks in advance!

2019-04-13 08-16-46
Pawan Kumar Sharma

@Weng Fai Chiew :

UltimatePDF works by rendering a publicly accessible URL using a headless Chromium engine. If the screen you're trying to print is protected by authentication, and the rendering engine cannot authenticate, it will default to rendering the login page.

  • Do not rely on session-based authentication for PDF generation.
  • Avoid printing screens that require login unless you implement token-based access.
  • If your report contains sensitive data, consider generating the PDF server-side and storing it securely (e.g., in S3 or as a binary in the database).

Some pointers for you:

  • Set the Report Screen to "Accessible to Everyone":

    • In ODC Studio, go to the screen you want to print.
    • Under Access Control, set it to "Everyone".
    • This allows UltimatePDF to access the screen without triggering the login flow.

  • Secure the Screen via Token or Conditional Logic (Optional but recommended):

    • Instead of exposing sensitive data, use a temporary token or query parameter to validate access.
    • Example: https://yourapp.com/ReportScreen?token=secure123
    • Validate the token in the screen's logic before rendering the report.
2025-07-22 10-30-27
Mandar Deshpande

Hi @Weng Fai Chiew 

This behavior is almost always related to authentication context not being passed to the PDF request.

When Ultimate PDF generates a document, it does not reuse the current browser session automatically. It makes a server-side HTTP request to the URL you provide. If that URL is protected by Azure AD SSO, and no valid session cookie/token is included in that internal request, Azure redirects to the login page — and that login page is what gets rendered into the PDF.

That’s why:

  • Normal browsing works fine
  • PDF generation shows the login screen
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.