Skip to main content
Question

Foused view not working in iframe

  • December 12, 2024
  • 2 replies
  • 120 views

Forum|alt.badge.img+2

Hello,

I am hosting multiple apps that require signing, so I created a dedicated app that uses the DocuSign JS library to provide a focused view signing interface. This app is designed to be accessed via an iframe by my other apps. But it keeps giving this error: 

Refused to frame 'https://apps-d.docusign.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://localhost:4209"

The signing app is hosted at https://localhost:4209, while the other apps are hosted on ports 4201 and 4206. The signing app works perfectly when accessed directly from the browser at https://localhost:4209, but it fails to load when embedded in an iframe within the apps hosted on ports 4201 and 4206.

I have added all the required domains in the request. Here’s the C# code of the request for generating the url

var recipientViewRequest = new RecipientViewRequest
            {
                ReturnUrl = request.ReturnUrl,
                ClientUserId = "1234",
                AuthenticationMethod = "None",
                UserName = request.RecipientName,
                Email = request.RecipientEmail,
                MessageOrigins = ["https://apps-d.docusign.com"],
                FrameAncestors = ["https://apps-d.docusign.com", "https://localhost:5002", "https://localhost:4209", "https://localhost:4206", "https://localhost:4201"],
            };

Does anyone know what is happening? Thanks.

2 replies

Forum|alt.badge.img+1
  • Docusign Employee
  • 4 replies
  • December 16, 2024

Hi ​@ONEsTony,

 

Does the ClientUserId value match the value used in the Envelopes:create API call? Is the returned URL from the EnvelopeViews:createRecipient being used directly, or is DocusignJS being used?


I also think that the main problem might be loading in an iframe within other apps. I don't think it is allowed.


Forum|alt.badge.img+2
  • Author
  • Newcomer
  • 1 reply
  • December 17, 2024

Yes, the ClientUserId is the same and I am using Docusign JS library.

So, it is not possible for the app that uses Docusign JS library to be accessed through iframe within other apps?