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!
@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.
Some pointers for you:
Set the Report Screen to "Accessible to Everyone":
Secure the Screen via Token or Conditional Logic (Optional but recommended):
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: