Kannan T
Kannan T

Reputation: 1749

Login into apache superset without credentials

I have one personal dashboard website and i have superset deployed on aws fargate, now the user logins separately to superset, i want user to directly login into the superset if they navigate from my dashboard, i read about AUTH_REMOTE_USER and tried to implement the same, but it doesn't work, am novice to flask, attaching my piece of code

class CustomSecurityManager(SupersetSecurityManager):
    logger.info("Using custom security manager")
    def auth_user_db(self, username, password):
        user = self.find_user(username=username)
        if user and check_password_hash(user.password, password):
            return user
        return None

    def login(self, request):
        logger.info("Using custom security manager")
        username = "kannant14"
        password = "Kannan@123"
        if username and password:
            user = self.auth_user_db(username, password)
            logger.info(" user details  {user}")
            if user:
                self.login_user(user)
                return redirect('http://localhost:8088/superset/welcome/')
            else:
                flash('Invalid credentials', 'warning')
        return redirect('/login/')


CUSTOM_SECURITY_MANAGER = CustomSecurityManager
AUTH_TYPE = AUTH_REMOTE_USER

So the above code i have tried adding in superset/docker/pythonpath_dev/superset_config.py but it's not working: TOO MANY REDIRECTS.

I have added in config.py file as well, in this still asking for credentials,

In short am looking for i don't want user to land on login page and let them goto home page straight away

Upvotes: 0

Views: 274

Answers (0)

Related Questions