You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "nagarajmmu (via GitHub)" <gi...@apache.org> on 2023/08/05 03:45:36 UTC
[GitHub] [superset] nagarajmmu opened a new issue, #24895: Superset in iFrame in another application is failed to login
nagarajmmu opened a new issue, #24895:
URL: https://github.com/apache/superset/issues/24895
A clear and concise description of what the bug is.
#### How to reproduce the bug
1. Add below key value pair in superset_config.py
SESSION_COOKIE_SAMESITE = "None"
SESSION_COOKIE_SECURE = False
SESSION_COOKIE_HTTPONLY = True
HTTP_HEADERS = {'X-Frame-Options': 'ALLOWALL'}
ENABLE_CORS = True
FEATURE_FLAGS = {"ALERT_REPORTS": True, "EMBEDDED_SUPERSET": True}
2. Build and Restart the superset by docker compose.
3. Added below superset URL in another app web UI as a iFrame
https://<superset_app_url>?standalone=true
### Expected results
Superset in IFrame should login and work as expected.
### Actual results
Not able to login to Superset with below error in browser console.
ERROR: _Blocked autofocusing on a <input> element in a cross-origin subframe._
#### Screenshots


### Environment
(please complete the following information):
- superset version: SUperset 2.1.0`
- python version: 3.8.0
We are planning to embedded superset dashboard in our application, as a iFrame. in iFrame superset login page appears, but not able to login, after login it will go back to login page only, because of SameSite cookie is Lax, we tried to set it to None, but not succeeded, we tried Nginx to resolve SameSite cookie, still SameSite cookie is appearing as a Lax. some time SameSite cookie appears None and Lax both, because of this reason, we are not able to use superset in our application,
Please let me know, if there any solution for this issue.
Thanks
Nagaraj M M
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Superset in iFrame in another application is failed to login [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #24895:
URL: https://github.com/apache/superset/issues/24895#issuecomment-1989570921
Agreed, this is not a bug. You should be using the embedded SDK here rather than just an iframe.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Superset in iFrame in another application is failed to login [superset]
Posted by "botnooo (via GitHub)" <gi...@apache.org>.
botnooo commented on issue #24895:
URL: https://github.com/apache/superset/issues/24895#issuecomment-2795780985
hi @LuvKaranwal21 did you find the solution
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Superset in iFrame in another application is failed to login [superset]
Posted by "LuvKaranwal21 (via GitHub)" <gi...@apache.org>.
LuvKaranwal21 commented on issue #24895:
URL: https://github.com/apache/superset/issues/24895#issuecomment-2796022821
Hello, yes, I resolved it with reverse proxy, basically my application's port ran on `3000` and when I embedded superset (running on 9000) in my app, I started getting cross origin errors, so I set up an reverse proxy like this:
```
app = FastAPI()
superset_port = 9000
@app.api_route("/superset/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD", "PATCH"])
async def proxy(request: Request, path: str):
proxy_url = f"http://localhost:{superset_port}/superset/{path}"
async with httpx.AsyncClient() as client:
# Forward the request
proxy_response = await client.request(
method=request.method,
url=proxy_url,
headers=request.headers.raw,
content=await request.body()
)
# Send the response back to the client
return Response(
content=proxy_response.content,
status_code=proxy_response.status_code,
headers=dict(proxy_response.headers)
)
.
.
.
and so on for all the routes present in superset ...around 12-15 more.
```
How I serve frontend files ?
```
from fastapi.staticfiles import StaticFiles
class CustomStaticFiles(StaticFiles):
async def get_response(self, path: str, scope):
response = await super().get_response(path, scope)
# Ensure JavaScript files are served with the correct MIME type
if path.endswith(".js"):
response.headers["Content-Type"] = "application/javascript"
return response
app.mount("/", CustomStaticFiles(directory="../ui/dist", html=True), name="my_app")
```
Now, I serve my app (FastAPI). Both of the above pieces of code resides in the same file. Also, make sure to build your frontend first before running the app.
Hope this helps, or gives a clue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Superset in iFrame in another application is failed to login [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #24895: Superset in iFrame in another application is failed to login
URL: https://github.com/apache/superset/issues/24895
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Superset in iFrame in another application is failed to login [superset]
Posted by "LuvKaranwal21 (via GitHub)" <gi...@apache.org>.
LuvKaranwal21 commented on issue #24895:
URL: https://github.com/apache/superset/issues/24895#issuecomment-2368237807
Hi @nagarajmmu, did you solved this problem ? If so please let me know how
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] huamichaelchen commented on issue #24895: Superset in iFrame in another application is failed to login
Posted by "huamichaelchen (via GitHub)" <gi...@apache.org>.
huamichaelchen commented on issue #24895:
URL: https://github.com/apache/superset/issues/24895#issuecomment-1701434627
It seems that you want to get the embedded dashboard to work.
Wrote a guide on it, hopefully, it helps someone 😄 Choose your preferred media 😝
https://huamichaelchen.substack.com/p/end-to-end-example-of-setting-up
https://medium.com/@huamichaelchen/end-to-end-example-of-setting-up-superset-embedded-dashboard-f72fc985559
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org