code: def login(self, username=None, password=''):
          
          auth = None
          if username is not None:
              # User login
              resp = self._login(username, password, self.client_id, self.client_secret)
              msg = "User Login"
          else:
              # client credentials
              resp = self._client(self.client_id, self.client_secret)
              msg = "Client credentials"
          if resp.status_code == requests.codes.ok:
              auth = resp.json()
              self.session.headers.update({
                  'Authorization':
                      ("%s %s" % (auth['token_type'], auth['access_token']))
              })
          else:
              error = {'description': "%s not valid" % msg }
              raise UAAException(error, resp.status_code)
          return auth
docs: Performs login with the provided credentials