Displaying PDF's on a ServiceNow Portal to Unathenticated users

Thomas Boyer
Tera Contributor

We are looking to display pdf attachments that are located on the sys_attachement table on a portal that is available to unauthenticated users. 

 

This portal is a public website and we require that the pdf is rendered in the page, and the user is not required to download the file or navigate to a new window (popup, new tab, etc). 

 

One of the solutions mentioned was to use an iframe but this is not ideal as it would weaken the security on the site and it still will not allow for files from the sys_attachment table to be rendered.

 

Has anyone attempted anything similar to this or have a recommendation as to how we might achieve this?

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Thomas Boyer 

everything within ServiceNow is shown based on authentication and access controls.

I don't think your requirement is feasible as access would be required for sys_attachment table and iframe is not an ideal way as it may allow attackers to inject any script and will weaken

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I agree with the entirety of what you have said. I am mainly looking to see if anyone has been able to render PDF's (in any way) on the portal without forcing a download or moving to a new tab/window. 

@Thomas Boyer 

Without download should work if you use document viewer in your instance

you can use URL like this and include view=true in URL

/nav_to.do?uri=sys_attachment.do?sys_id=fa615af2db573b001c1d468b3a9619fc&view=true

Without authentication it's not possible to show attachment to user.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Thomas Boyer 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader