def authenticate(self):
<EOL>self._swimlane._session.auth = None<EOL>resp = self._swimlane.request(<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>json={<EOL>'<STR_LIT>': self._username,<EOL>'<STR_LIT:password>': self._password<EOL>},<EOL>)<EOL>self._swimlane._session.auth = self<EOL>json_content = resp.json()<EOL>token = json_content.pop('<STR_LIT>', None)<EOL>token_data = jwt.decode(token, verify=False)<EOL>token_expiration = pendulum.from_timestamp(token_data['<STR_LIT>'])<EOL>headers = {<EOL>'<STR_LIT>': '<STR_LIT>'.format(token)<EOL>}<EOL>user = User(self._swimlane, _user_raw_from_login_content(json_content))<EOL>self._login_headers = headers<EOL>self.user = user<EOL>self._token_expiration = token_expiration<EOL>
Send login request and update User instance, login headers, and token expiration