code: def login(self):
          
          access_token = self._get_access_token()
          try:
              super(IAMSession, self).request(
                  'POST',
                  self._session_url,
                  headers={'Content-Type': 'application/json'},
                  data=json.dumps({'access_token': access_token})
              ).raise_for_status()
  
          except RequestException:
              raise CloudantException(
                  'Failed to exchange IAM token with Cloudant')
docs: Perform IAM cookie based user login.