The root cause here isn't your server or Rails configuration, or even intrinsically tied to Safari....its because the web browser is blocking 3rd party cookies.
In an embedded signing workflow, the DocuSign window within the iFrame will try to drop an authentication cookie on the signers machine. Since its coming from demo.docusign.net
, the browser considers this a 3rd party cookie (versus 1st party cookies which is what your server/domain drops directly). Safari blocks 3rd party cookies by default where almost all other browsers allow them by default.
If you look at the error URL, note the following:
- demo.docusign.net is whats refusing to be displayed in an iFrame because IT is what set the
X-Frame-Options
header, eg the header issue is from the DocuSign URL, NOT your server pages (including whatever you passed or set for returnURL
).
SessionTimeout.aspx?
is on the URL not the normal SigningStart
param...this is because the cookie was blocked and DocuSign has invalided the signing URL
You can reproduce the issue on Chrome for testing verification by following the instructions here: https://support.google.com/chrome/answer/95647?hl=en to set it to block 3rd party cookies.
Note you may see inconsistent results in testing because if a valid DocuSign cookie is already on the clients machine, the browser may not consider it 3rd party anymore and allow the new authentication cookie to drop, allowing the signing window to load successfully
Unfortunately there are no good, 'turn-key' solutions. Your options are:
- If you can control or influence your client browsers' settings (like in a corporate network) you can set them all to allow 3rd party cookies or whitelist docusign
- Open the signing window in a new tab or popup. This is probably the best approach but can complicate user experience and if you use the JS / popup route (vs
target='blank'
for a new window), it has the potential to get stuck in ad / popup blockers. See here to help get around that if you go the JS route: Bypass popup blocker on window.open when JQuery event.preventDefault() is set
- some set of custom hack / workarounds to get the cookie placed first and then reload the signing window. These have has varying degrees of success but the root issue is the same as a lot of Facebook apps:
More resources: