kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
2.94k stars 492 forks source link

Mycodo in an iFrame #1257

Closed Masyun closed 1 year ago

Masyun commented 1 year ago

When i try to run Mycodo inside of an iFrame in my react application, the login flow doesn't work

I'm building an admin dashboard which allows a user to manage multiple Mycodo instances and want to use an iFrame to accomplish this. However, when i try to login through the iFrame in my application, the request is sent but nothing seems to happen -

Versions:

Reproducibility

Please list specific setup details that are involved and the steps to reproduce the behavior:

  1. import https://www.npmjs.com/package/react-iframe into the react application
  2. insert mycodo host IP as the url property of the iframe component
  3. Open up the application, go to iFrame component, it should show the mycodo login page
  4. Try to log in
  5. login attempt doesn't do anything

Expected behavior

I expect to run into more problems down the line with the iFrame, however getting the login to work is a big step in solving these issues. I want to be able to manage, operate and monitor multiple Mycodo instances through my own dashboard It could be a CORS issue and i've experimented with the sandbox property on the iframe but without success.

What would be my options to get this to work for a PoC product?

kizniche commented 1 year ago

Is it even possible to put HTTPS requests in an iframe? I know next to nothing about iframes, so I'm not likely to be any help. This is also not really an issue with Mycodo.