You are viewing limited content. For full access, please sign in.

Question

Question

Change URL Used in Custom HTML Field Based on URL Being Used to Access Forms

asked on March 21, 2024

I have a Forms process that up till now has just been used internally. This process uses a Custom HTML field to insert an iFrame into the form and show a document from a Laserfiche repository.

We are now working on allowing access to this process outside of the network using DMZ servers. Users will be able to use Forms and the Web Client from a browser and the Laserfiche Mobile app.

Since the URL being used for the iFrame is not accessible when accessing the form from the DMZ, is there a way to change the URL being used in the Custom HTML field based on if the user is accessing it from internal vs external?

I know that I could add another Custom HTML field that uses an external address, but it starts making the form messy and more complicated.

I look forward to seeing everyone's ideas.

0 0

Replies

replied on March 21, 2024

I'd typically handle something like this by always using the same URL, the "external" one, along with split DNS so the public and private routes (and destinations, if necessary) differed.

If you're relying on an automatic LFDSSTS auth handshake based on an existing STS token to make getting an authenticated session in the Web Client/WebLink iFrame appear seamless, be aware that STS tokens exist within a domain's "cookie jar" context. This could degrade the auth experience for internal users with internal STS tokens going to the doc view iFrame on the external domain.

There's also a JavaScript function or HTML property that gets the current site hostname. You could potentially use that to make the iFrame URL something dynamic like (bad pseudocode warning):

myiFrameURLBase = "https://" + $currentHostname + "/WebLink/DocView.aspx"
# when internal, $currentHostname expect to be "internal.example-int.com"
# when external, $currentHostname expected to be "external.example-ext.com"
myiFrameURLParams = "?docid=" + $docIdFromWherever
myiFrameURL = myiFrameURLBase + myiFrameURLParams

If you need only part of $currentHostname, like the ".example-int.com" portion, slice and dice with regex/string manipulation as necessary.

2 0
replied on March 22, 2024 Show version history

Thanks for the reply Sam. I am checking on if we are able to change the external URL we are using to match what is being used internally. There are a few different teams that has to go through to get done. That is my preferred option.

 From what I've tested so far, the Mobile app doesn't play nice with iframes either way unless you first log into the Web Client using your browser first. Any ideas on how to get around that?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.