How Superset WebDriver Performs Login Authentication

Comment From: request-info[bot]

We would appreciate it if you could provide us with more info about this issue/pr! Please do not leave the title or description empty.

Comment From: dosubot[bot]

Superset's WebDriver authentication works by programmatically establishing a logged-in session for the browser automation, rather than manually filling out the login form. The core mechanism uses the MachineAuthProvider, which logs in a user via Flask-Login, retrieves the session cookies, and injects them directly into the WebDriver session. This ensures the WebDriver is authenticated as the specified user for tasks like screenshots or integration tests. You can override this process with a custom function (such as auth_driver) if you want to automate the login form using Selenium, but by default, Superset handles authentication by setting cookies, not by simulating UI login steps. See the implementation details in the code for MachineAuthProvider and WebDriverSelenium classes for more info [source] [source].

If you want to override the default, you can set WEBDRIVER_AUTH_FUNC to a custom function that uses Selenium to fill in the login form [source].

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

Comment From: zhangdong1015

Was there no database query?

Comment From: zhangdong1015

@dosu

Comment From: dosubot[bot]

No, in the default setup, Superset's WebDriver login authentication does not perform any database queries. It uses Flask-Login to create a session for the specified user and sets the necessary session cookies directly in the WebDriver, all handled in-memory or via client cookies—no database interaction occurs in this flow. Database queries are only involved if you use database authentication (AUTH_DB) for regular user logins, but the WebDriver automation process itself does not trigger them unless you customize the authentication logic to do so.
Source: MachineAuthProvider implementation

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

Comment From: sfirke

Superset uses Flask-AppBuilder's security module to handle all of its authentication. Check out those docs and that codebase for an understanding of how authentication works in Superset.

I'm going to convert this to a discussion since it seems more like a question about how Superset works than a bug report.