GitHub user dosubot[bot] added a comment to the discussion: How to enable SSO 
login using microsoft azure,  having xml file of metadata, deploying using 
Helmchart

<!-- Answer -->
To resolve the error "Your CUSTOM_SECURITY_MANAGER must now extend 
SupersetSecurityManager, not FAB's security manager," ensure that your custom 
security manager class extends `SupersetSecurityManager` instead of the Flask 
App Builder (FAB) security manager. Here's how you can define your custom 
security manager:

```python
from superset.security import SupersetSecurityManager

class CustomSsoSecurityManager(SupersetSecurityManager):
    # Implement your custom security logic here
    def oauth_user_info(self, provider, response=None):
        # Example implementation for handling OAuth user information
        if provider == 'azure':
            me = 
self.appbuilder.sm.oauth_remotes[provider].get('userDetails').data
            return {
                'name': me['name'],
                'email': me['email'],
                'id': me['user_name'],
                'username': me['user_name'],
                'first_name': '',
                'last_name': ''
            }
```

Then, configure Superset to use your `CustomSsoSecurityManager` by setting it 
in the configuration:

```python
CUSTOM_SECURITY_MANAGER = CustomSsoSecurityManager
```

This change ensures that your custom security manager is compatible with the 
current requirements of Apache Superset 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset/initialization/__init__.py)</sup>.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*

---
<sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/11efaa09-87a2-4cf4-a5c8-43bf267b7ad3?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/11efaa09-87a2-4cf4-a5c8-43bf267b7ad3?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/11efaa09-87a2-4cf4-a5c8-43bf267b7ad3?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/11efaa09-87a2-4cf4-a5c8-43bf267b7ad3?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/11efaa09-87a2-4cf4-a5c8-43bf267b7ad3?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/11efaa09-87a2-4cf4-a5c8-43bf267b7ad3?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/11efaa09-87a2-4cf4-a5c8-43bf267b7ad3?feedback_type=other)</sup>


GitHub link: 
https://github.com/apache/superset/discussions/32787#discussioncomment-12576132

----
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]

Reply via email to