Support Redirects after Auth in Superset

Description

We need to authenticate each user in Superset by pointing to {baseURL}/login/openlmis after it runs through that, we need to redirect to a particular URL for the dashboard that is being seen. For example, we would want to go to {baseUrl}/superset/dashboard/1/ after the user was authenticated.

When a user is authenticated in Superset's oauth process, they are automatically redirected to the index screen as is handled by flask appbuilder (https://github.com/dpgaspar/Flask-AppBuilder/blob/master/flask_appbuilder/security/views.py#L498)

We need to figure out a way to redirect after the user logs in to the URL that the user intends to visit. This can be done in a couple of ways:

  • We can have our security manager support a URL parameter that tells the site where to redirect ({baseUrl}/login/openlmis?redirect_url={baseUrl}/superset/dashboard/1/)

  • We can post the URL, have Superset redirect to the login page and then read a cookie that shows the original intent as is done in https://github.com/ajgil/Superset-remote-user-auth-nginx (Note that this uses the remoteUserAuth, not oAuth, so we would have to modify the code found there)

Status

Assignee

Craig Appl

Reporter

Craig Appl

Labels

Story Points

3

Epic Link

Sprint

None

Fix versions

Affects versions

Priority

Critical
Configure