def authenticate(self, force=False):
        if not self._is_authentication_needed(force=force):
            return self

        headers = {}
        action = 'b2_authorize_account'
        auth_b64 = base64.b64encode(b('%s:%s' % (self.user_id, self.key)))
        headers['Authorization'] = 'Basic %s' % (auth_b64.decode('utf-8'))

        action = API_PATH + 'b2_authorize_account'
        resp = self.request(action=action, headers=headers, method='GET')

        if resp.status == httplib.OK:
            self._parse_and_set_auth_info(data=resp.object)
        else:
            raise Exception('Failed to authenticate: %s' % (str(resp.object)))

        return self
:param force: Force authentication if if we have already obtained the
dataset/ETHPy150Open apache/libcloud/libcloud/storage/drivers/backblaze_b2.py/BackblazeB2AuthConnection.authenticate