GitHub user dosubot[bot] added a comment to the discussion: How to update user datas every they login SSO in Superset 5.0.0?
<!-- Answer --> Superset matches SSO users by the username field only, not by email. When you log in with Azure SSO, Superset uses the username returned by Azure (usually `userPrincipalName`) to find the existing user in its database. If you change just the username or just the email, Superset can still find the user by the unchanged username and let you log in. But if you change both username and email, Superset can't find a matching user—so login fails, especially with `AUTH_USER_REGISTRATION=False` (which disables auto-registration) [source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/security/manager.py). For reliable SSO, make sure the username in Superset always matches the value Azure sends for `userPrincipalName`. Email is just an attribute and doesn't affect login matching. If you need to update user info on each login, use a custom `oauth_user_info` method to sync attributes, but keep the username consistent for SSO to work. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/6f34b63f-7ef0-4b40-81db-2bb696782087?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/6f34b63f-7ef0-4b40-81db-2bb696782087?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/6f34b63f-7ef0-4b40-81db-2bb696782087?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/6f34b63f-7ef0-4b40-81db-2bb696782087?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6f34b63f-7ef0-4b40-81db-2bb696782087?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/6f34b63f-7ef0-4b40-81db-2bb696782087?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6f34b63f-7ef0-4b40-81db-2bb696782087?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)& nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/34608) GitHub link: https://github.com/apache/superset/discussions/34608#discussioncomment-14098923 ---- 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]
