[Python] Superset iframe login redirect

Discussão em 'Python' iniciado por Stack, Dezembro 18, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to understand how one should be able to insert Superset's dashboards and charts inside another application. At the moment I am at this step: I have inserted the iframe of a chart inside my html page and I am presented with Superset login page; after I insert the credentials I am redirected again on the login page, without ever seeing the chart. What am I doing wrong ? Am I missing part of the picture here ?

    Here's my superset_config.py

    import logging
    import os

    SQLALCHEMY_DATABASE_URI="mysql+pymysql://superset:superset@127.0.0.1:3306/superset"

    REDIS_HOST="localhost"
    REDIS_PORT=6379

    # Will allow user self registration, allowing to create Flask users from Authorized User
    AUTH_USER_REGISTRATION = True

    # The default user self registration role
    AUTH_USER_REGISTRATION_ROLE = "Public"

    # Flask-WTF flag for CSRF
    WTF_CSRF_ENABLED = False


    And here's the basic html page I built with the iframe

    <!DOCTYPE html>
    <html>
    <body>

    <h1>iframe integration</h1>

    <iframe
    width="800"
    height="800"
    seamless
    frameBorder="0"
    scrolling="yes"
    src="http://<remote server hostname>:8088/superset/explore/?r=2&standalone=true&height=400"
    >
    </iframe>

    </body>
    </html>


    When I enter the html page from Firefox I see the login page, like in the picture below

    [​IMG]

    When I insert the credentials I am redirected to the same login page.

    This is what I see from Superset's logs

    INFO:werkzeug:<my ip>- - [07/Apr/2021 13:12:07] "POST /login/?next=http%3A%2F%2F<remote server hostname>%3A8088%2Fsuperset%2Fexplore%2F%3Fr%3D2%26standalone%3Dtrue%26height%3D400 HTTP/1.1" 302 -
    INFO:werkzeug:<my ip> - - [07/Apr/2021 13:12:07] "GET / HTTP/1.1" 302 -
    INFO:werkzeug:<my ip> - - [07/Apr/2021 13:12:07] "GET /superset/welcome HTTP/1.1" 302 -
    INFO:werkzeug:<my ip> - - [07/Apr/2021 13:12:07] "GET /login/ HTTP/1.1" 200 -

    Continue reading...

Compartilhe esta Página