Beispiel #1
0
    def login(self):
        try:
            username = get_arg("username")
            password = get_arg("password")
            if username and password:
                actor_id = self.idm_client.check_actor_credentials(username, password)
                user_info = self._get_user_info(actor_id, username)
                return build_json_response(user_info)

            else:
                raise BadRequest("Username or password missing")

        except Exception:
            return build_json_error()
Beispiel #2
0
    def login(self):
        """ Explicit (non-token) login and creation of a server session (Cookie based). """
        try:
            username = get_arg("username")
            password = get_arg("password")
            if username and password:
                actor_id = self.idm_client.check_actor_credentials(username, password)
                user_info = self._set_server_session(actor_id, username)
                return build_json_response(user_info)

            else:
                raise BadRequest("Username or password missing")

        except Exception:
            return build_json_error()
Beispiel #3
0
    def login(self):
        """ Explicit (non-token) login and creation of a server session (Cookie based). """
        try:
            username = get_arg("username")
            password = get_arg("password")
            if username and password:
                actor_id = self.idm_client.check_actor_credentials(username, password)
                user_info = self._set_server_session(actor_id, username)
                return build_json_response(user_info)

            else:
                raise BadRequest("Username or password missing")

        except Exception:
            return build_json_error()