apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
61.91k stars 13.56k forks source link

AUTH_REMOTE_USER and Scheduled email reports #11119

Closed yackushevas closed 1 year ago

yackushevas commented 3 years ago

Expected results

Ability to work with service users when using AUTH_TYPE = AUTH_REMOTE_USER.

Actual results

The user specified in EMAIL_REPORTS_USER does not have a simplified authorization option (or I could not find it in the documentation).

How to reproduce the bug

  1. Set AUTH_TYPE = AUTH_REMOTE_USER and use CUSTOM_SECURITY_MANAGER
  2. Set ENABLE_SCHEDULED_EMAIL_REPORTS = True
  3. See error:
    Exception on /login/ [GET]
    Traceback (most recent call last):
    File "/opt/superset/venv/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
    File "/opt/superset/venv/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/opt/superset/venv/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "/opt/superset/venv/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
    File "/opt/superset/venv/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
    File "/opt/superset/venv/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
    File "/opt/superset/venv/bin/superset_config.py", line 142, in login
    login_user(user)
    File "/opt/superset/venv/lib/python3.6/site-packages/flask_login/utils.py", line 158, in login_user
    if not force and not user.is_active:
    AttributeError: 'NoneType' object has no attribute 'is_active'
issue-label-bot[bot] commented 3 years ago

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.53. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

jawabuu commented 3 years ago

Hey @yackushevas Are you using any middleware? Could you share your CustomSecurityManager?

jawabuu commented 3 years ago

@mistercrunch Using your example here https://gist.github.com/mistercrunch/6d31af4a11c47edcedc1ba6ceb5f5fab works fine for remote user login but returns

raised unexpected: WebDriverException('Failed to decode response from marionette', None, None) or NoSuchElementException('Unable to locate element: .grid-container', None, None)

for email Reports. Switching to AUTH_OAUTH or AUTH_DB resolves it.

yackushevas commented 3 years ago

for email Reports. Switching to AUTH_OAUTH or AUTH_DB resolves it.

Then AUTH_REMOTE_USER will not work.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

rusackas commented 1 year ago

Based on timestamps and inactivity of this thread, I believe this issue is in reference to an unspecified yet unsupported version of Superset.

If anyone thinks this is still relevant today in Superset 1.5.x or 2.x.x versions, please let us know. Otherwise, I think we can probably close this one out. CC @eschutho for input or confirmation of closability (which should be a word).

eschutho commented 1 year ago

Correct, ENABLE_SCHEDULED_EMAIL_REPORTS has been deprecated.