Esempio n. 1
0
    def authenticate_with_password(self,
                                   username,
                                   password,
                                   security_question_id=None,
                                   security_question_answer=None):
        """Performs Username/Password Authentication

        :param string username: your SoftLayer username
        :param string password: your SoftLayer password
        :param int security_question_id: The security question id to answer
        :param string security_question_answer: The answer to the security
                                                question

        """
        self.auth = None
        res = self['User_Customer'].getPortalLoginToken(
            username, password, security_question_id, security_question_answer)
        self.auth = slauth.TokenAuthentication(res['userId'], res['hash'])
        return res['userId'], res['hash']
Esempio n. 2
0
 def set_up(self):
     self.auth = auth.TokenAuthentication(12345, 'TOKEN')