GitHub user dosubot[bot] added a comment to the discussion: Superset SSO login is not working after upgrading it to 6.1.0rc1, lending it to username and password page
<!-- Answer --> The problem is that your `register_views()` override calls `super().register_views()` which sets `self.auth_view = SupersetAuthView` (the default username/password view), and your code never overrides it with your `AuthSAMLView` [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/security/manager.py#L2788-L2796). You need to set `self.auth_view` to your custom view. Based on how `SupersetSecurityManager` works, it sets `self.auth_view` **before** calling `super().register_views()`. You should do the same — but you need to **skip** the parent's assignment of `SupersetAuthView`. The cleanest approach is to **not** call `super().register_views()` from `SupersetSecurityManager`, and instead call the grandparent (FAB's `SecurityManager`): ```python from flask_appbuilder.security.sqla.manager import SecurityManager as FABSecurityManager class SAMLSSOSecurityManager(SupersetSecurityManager): def __init__(self, appbuilder): super().__init__(appbuilder) if self.auth_type == AUTH_DB and ARKOSE_SECURITY_MANAGER == "SSO": self.saml_client = get_saml_client() def register_views(self): # Register YOUR custom auth view (this sets self.auth_view with a proper endpoint) self.auth_view = self.appbuilder.add_view_no_menu(AuthSAMLView) # Skip SupersetSecurityManager.register_views() which would overwrite # self.auth_view with SupersetAuthView. Call FAB's register_views() directly. FABSecurityManager.register_views(self) ``` **Why this works:** - `self.appbuilder.add_view_no_menu(AuthSAMLView)` registers the view with Flask and returns an instance with a valid `endpoint` attribute (derived from the class name `"AuthSAMLView"`) - This satisfies `get_url_for_login` which needs `self.sm.auth_view.endpoint` to not be `None` - Skipping `SupersetSecurityManager.register_views()` avoids it overwriting your `auth_view` with the default `SupersetAuthView` **Alternatively**, if skipping the parent causes other issues (like missing menu cleanup), you can call `super()` and then re-assign: ```python def register_views(self): super().register_views() # Override the auth_view that super() just registered self.auth_view = self.appbuilder.add_view_no_menu(AuthSAMLView) ``` The first approach is cleaner but the second is safer if `SupersetSecurityManager.register_views()` does other important work you don't want to lose. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=a21c9aa7-e061-4c53-8295-5275f989a351) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset) GitHub link: https://github.com/apache/superset/discussions/39950#discussioncomment-16841419 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
