Embedding Rstudio in an iframe (either rstudio cloud or rstudio server)

I've been redesigning what amounts to the course website for a class I'm teaching this fall and have been experimenting with embedding various assets via iframes. I've had success with cocalc (a more general collaborative computational engine that works with latex, jupyter notebooks, R markdown files, etc) but haven't yet been able to figure out how to get an Rstudio project working, either via cloud or Rstudio server. I've learned there are several options that web developers can set to prevent their sites being placed into an iframe, but I haven't yet figured out if in fact that's the case and if so, if there's any way around it.

Has anyone had success embedding a web-hosted RStudio project?

Hi,

I'm not aware of anyone that has attempted to embed a project into another website. It might be possible if the project exists in "Your Workspace" and is set to public. Keep in mind that users attempting to access the project will still need to have an RStudio Cloud account, and log in to RStudio Cloud to use the project (anonymous access isn't supported today).

-Andy

Interesting. I've tried that, just embedding https://rstudio.cloud/projects and when I click on a public project, I get this (this is accessing that url through an iframe in the course website):

Where the "redirecting" pop-up window flickers but never resolves itself, it just gets hung up here. I get the same behavior if I instead put the project's url in the iframe. When I point the iframe on my website to the specific iframe at rstudio cloud that contains the IDE (here), I get the same screen, albeit with the toolbars removed.

So it looks like the embedding is actually happening ok, it's the authentication that's the issue. In general, I've found authentication done through browser cookies is the most seamless with this use of iframes, so this must be doing something different.

If you're wondering what the use case is here, the course website currently has audio/video chat enabled, so students can collaborate on any content that they're both viewing. If they open Rstudio cloud in a separate tab, they lose the video chat. I know it's a strange set up, but it'd be terrific if I were able to get this working.

Thanks for any other pointers you might have,
Andrew

Andrew,

Can you capture the output from the browser console and share it with me?

Here are some instructions in case you're not faimilar:

https://support.happyfox.com/kb/article/882-accessing-the-browser-console-and-network-logs/

Sure thing:

Let me know if that's not what you were looking for.

Andrew