Use Authelia as OpenID Connect authorization provider in Superset #34054
serra
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
Authelia is a 2FA & SSO authentication server which is dedicated to the security of applications and users.
We use Authelia for SSO across several web applications, Superset amongst others.
In our case, Authelia is backed by LLDAP as a directory service.
Requirements
Gamma
role.superset_admin
group in LLDAP, then they should get theAdmin
role in superset.Solution
Superset is built using Flask App Builder (FAB), which comes with authorization support for LDAP and OAuth2 amongst others.
We can configure an OpenID Connect (OIDC) client in Authelia, and then consume this service as an OAuth2 client from Superset.
OIDC is an extension of OAuth2. OIDC is not explicitly supported by FAB. We can however use the OIDC endpoint for more concise configuration (see Superset OAuth2 configuration docs). Using the OAuth2 implementation in FAB also gives us automatic user creation and role synchronization, if we need it.
FAB comes with support for several OAuth2 providers (Facebook, Github, and Authentik to name a few), but does not have built-in support for Authelia yet. So we have to define a function that maps the user info from Authelia to the
user_info
structure used by FAB. We do this by creating a customSecurityManager
:Then use this security manager in
superset_config.py
:Follow up
These are some ideas to follow-up:
First Name
andLast Name
fields are not filled in Superset, although they are in the mapped user infoAppendices
Authelia configuration
I assume that you have Authelia setup and running, and that you know how to generate secrets for your clients.
I use the following client configuration:
When generating the secret for superset, I also generate an OIDC
client_secret.json
:Beta Was this translation helpful? Give feedback.
All reactions