GitHub user dosubot[bot] added a comment to the discussion: How to customize authentication in version 6
<!-- Answer --> For logging to work in your custom authentication view, make sure you instantiate the logger **at module level** (outside the class), as [Superset does in its security manager](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/security/manager.py#L96): ```python import logging # Must be at module level, outside the class logger = logging.getLogger(__name__) class CustomAuthRemoteUserView(AuthRemoteUserView): @expose('/login/') def login(self): logger.info("Custom login function called") logger.info(f"REMOTE_USER: {request.environ.get('REMOTE_USER')}") # ... rest of your code ``` Also, ensure your `superset_config.py` has the log level set to show info messages ([reference](https://github.com/apache/superset/discussions/32998)): ```python import logging LOG_LEVEL = logging.DEBUG # or logging.INFO ``` As for the blank "Sign in" card with no buttons - this is actually a key symptom. In Superset 6, the login page is **React-rendered**, and `AUTH_REMOTE_USER` is supposed to bypass the login UI entirely. The fact that you're seeing a blank card suggests the React frontend isn't recognizing your auth type. Try adding this to your `superset_config.py` if you haven't already: ```python from flask_appbuilder.security.manager import AUTH_REMOTE_USER AUTH_TYPE = AUTH_REMOTE_USER ``` Also verify that your custom `AuthRemoteUserView` is being registered by checking if requests are hitting your custom `login` endpoint at `/authremoteuserview/login/`. The blank sign-in card could mean requests are going to the default React login route (`/login/`) instead of your custom remote user view. <!-- 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/8432e251-9886-4167-bbf5-cb1aa44c0068?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8432e251-9886-4167-bbf5-cb1aa44c0068?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8432e251-9886-4167-bbf5-cb1aa44c0068?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8432e251-9886-4167-bbf5-cb1aa44c0068?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8432e251-9886-4167-bbf5-cb1aa44c0068?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8432e251-9886-4167-bbf5-cb1aa44c0068?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8432e251-9886-4167-bbf5-cb1aa44c0068?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=For%20logging%20to%20work%20in%20your%20custom%20authentication%20view%2C%20make%20sure%20you%20instantiate%20the%20logger%20%2A%2Aat%20module%20level%2A%2A%20%28outside%20the%20class%29%2C%20as%20%5BSuperset%20does%20in%20its%20security%20manager%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/security/manager.py%23L96%29%3A%0A%0A%60%60%60python%0Aimport%20logging%0A%0A%23%20Must%20be%20at%20module%20level%2C%20outside%20the%20class%0Alogger%20%3D%20logging.getLogger%28__name__%29%0A%0Aclass%20CustomAuthRemoteUserView%28AuthRemoteUserView%29%3A%0A%20%20%20%20%40expose%28%27/login/%27%29%0A%20%20%20%20def%20login%28self%29%3A%0A%20%20%20%20%20%20%20%20logger.info%28%22Custom%20login%20function%20called% 22%29%0A%20%20%20%20%20%20%20%20logger.info%28f%22REMOTE_USER%3A%20%7Brequest.environ.get%28%27REMOTE_USER%27%29%7D%22%29%0A%20%20%20%20%20%20%20%20%23%20...%20rest%20of%20your%20code%0A%60%60%60%0A%0AAlso%2C%20ensure%20your%20%60superset_config.py%60%20has%20the%20log%20level%20set%20to%20show%20info%20messages%20%28%5Breference%5D%28https%3A//github.com/apache/superset/discussions/32998%29%29%3A%0A%0A%60%60%60python%0Aimport%20logging%0ALOG_LEVEL%20%3D%20logging.DEBUG%20%20%23%20or%20logging.INFO%0A%60%60%60%0A%0AAs%20for%20the%20blank%20%22Sign%20in%22%20card%20with%20no%20buttons%20-%20this%20is%20actually%20a%20key%20symptom.%20In%20Superset%206%2C%20the%20login%20page%20is%20%2A%2AReact-rendered%2A%2A%2C%20and%20%60AUTH_REMOTE_USER%60%20is%20supposed%20to%20bypass%20the%20login%20UI%20entirely.%20The%20fact%20that%20you%27re%20seeing%20a%20blank%20card%20suggests%20the%20React%20frontend%20isn%27t%20recognizing%20your%20auth%20type.%0A%0ATry%20adding%20this%20to%20your%20%60su perset_config.py%60%20if%20you%20haven%27t%20already%3A%0A%60%60%60python%0Afrom%20flask_appbuilder.security.manager%20import%20AUTH_REMOTE_USER%0AAUTH_TYPE%20%3D%20AUTH_REMOTE_USER%0A%60%60%60%0A%0AAlso%20verify%20that%20your%20custom%20%60AuthRemoteUserView%60%20is%20being%20registered%20by%20checking%20if%20requests%20are%20hitting%20your%20custom%20%60login%60%20endpoint%20at%20%60/authremoteuserview/login/%60.%20The%20blank%20sign-in%20card%20could%20mean%20requests%20are%20going%20to%20the%20default%20React%20login%20route%20%28%60/login/%60%29%20instead%20of%20your%20custom%20remote%20user%20view.) [](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/38199) GitHub link: https://github.com/apache/superset/discussions/38199#discussioncomment-15902342 ---- 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]
