How can I bypass login page for Superset when using OAuth2 for authentication?

Viewed 1840

I am using Superset 0.36 and set up successfully OAUTH2 login using my SSO- Okta. However the redirect uri http://[site]:8088/oauth-authorized/okta that needs to be configured for Flask Application Builder to work redirects to a login page where the user needs to choose a provider and click sign-in. This is an unnecessary step since the user already logged into OKTA and should not need to login again.

Can someone help with any FAB configuration that would help set up an auto login using OAUTH2 so that we can bypass this redundant login page which my users find confusing and sometimes get stuck on. If there is no way to bypass it can someone tell me how I can customize the login page to instruct users how to use it?

1 Answers

I had the same issue (although not with Okta, and version 0.37). From the javascript in that login page I figured out the final URL. Look at the signin function that’s called when you click the button:

function signin() {
    if (currentSelection != "") {
        window.location.href = baseLoginUrl + currentSelection + next;
    }
}

In your case I guess it would be something like:

http://[site]:8088/login/okta/?next=[dashboard]

Disclaimer: I’m absolutely not sure if this is the proper way to do it, but in my case it was just a POC so it didn’t matter much.

Also you should make sure you understand those 3 settings in superset_config.py regarding the Superset session cookie behavior in HTTP vs. HTTPS:

SESSION_COOKIE_HTTPONLY = False
SESSION_COOKIE_SAMESITE = "None"
SESSION_COOKIE_SECURE = True

And of course this makes sense only if you want to allow 1 authentication provider.

Related