code: def do_direct_authorization(self, session):
          
          logger.info('Doing direct authorization, app_id=%s', self.app_id)
          auth_data = {
              'client_id': self.app_id,
              'client_secret': self._client_secret,
              'username': self._login,
              'password': self._password,
              'grant_type': 'password',
              '2fa_supported': self._two_fa_supported,
              'scope': self.scope,
              'v': self.api_version
          }
          response = session.post(url=self.DIRECT_AUTHORIZE_URL,
                                  data=stringify_values(auth_data))
          try:
              response_json = response.json()
          except ValueError:  # not JSON in response
              error_message = 'OAuth2 grant access error'
              logger.error(response.text)
              raise VkAuthError(error_message)
          else:
              if 'access_token' in response_json:
                  return response_json
  
              if response_json['error'] == 'need_validation':
                  return self.direct_auth_require_2fa(session, auth_data)
              elif response_json['error'] == 'need_captcha':
                  return self.direct_auth_require_captcha(session, response_json, auth_data)
              else:
                  error_message = 'VK error: [{}] {}'.format(
                      response_json['error'], response_json['error_description'])
                  raise VkAuthError(error_message)
docs: Direct Authorization, more info: https://vk.com/dev/auth_direct