Multiplr login configurations #31373
Replies: 1 comment
-
To implement multiple authentication mechanisms in Apache Superset using Flask App Builder (FAB), you can configure different authentication types in the Here's a general approach:
Here's a simplified example of how you might configure this: from superset.security import SupersetSecurityManager
from flask_appbuilder.security.manager import AUTH_OAUTH, AUTH_DB
class CustomSecurityManager(SupersetSecurityManager):
def authenticate(self, request):
# Custom token validation logic
if self.validate_custom_token(request):
return self.get_user_from_custom_token(request)
# Fallback to OAuth
user = self.oauth_user_info(request)
if user:
return user
# Fallback to database authentication
return super().authenticate(request)
# In superset_config.py
CUSTOM_SECURITY_MANAGER = CustomSecurityManager
AUTH_TYPE = AUTH_OAUTH # Set primary auth type
# Configure OAuth and DB as needed This setup allows you to define a sequence of authentication methods, providing flexibility in handling multiple login mechanisms. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
Hello Team,
I am implementing custom security manager to have embedding validating our custom token. So i used AuthRemoteUserView and overriden the login method. Now as part of my fallback i want to add other login mechanisms like oauth/default db. As per my understanding FAB security doesnt support multiple mechanisms to use at once. Any recommendations on how to implement this scenario?
Beta Was this translation helpful? Give feedback.
All reactions