async def request_token(self, token_params=None, key_name=None, key_secret=None, auth_callback=None, auth_url=None, auth_method=None, auth_headers=None, auth_params=None, query_time=None):
    token_params = (token_params or {})
    token_params = dict(self.auth_options.default_token_params, **token_params)
    key_name = (key_name or self.auth_options.key_name)
    key_secret = (key_secret or self.auth_options.key_secret)
    log.debug(('Auth callback: %s' % auth_callback))
    log.debug(('Auth options: %s' % self.auth_options))
    if (query_time is None):
        query_time = self.auth_options.query_time
    query_time = bool(query_time)
    auth_callback = (auth_callback or self.auth_options.auth_callback)
    auth_url = (auth_url or self.auth_options.auth_url)
    auth_params = (auth_params or self.auth_options.auth_params or {})
    auth_method = (auth_method or self.auth_options.auth_method).upper()
    auth_headers = (auth_headers or self.auth_options.auth_headers or {})
    log.debug(('Token Params: %s' % token_params))
    if auth_callback:
        log.debug('using token auth with authCallback')
        token_request = (await auth_callback(token_params))
    elif auth_url:
        log.debug('using token auth with authUrl')
        token_request = (await self.token_request_from_auth_url(auth_method, auth_url, token_params, auth_headers, auth_params))
    else:
        token_request = (await self.create_token_request(token_params, key_name=key_name, key_secret=key_secret, query_time=query_time))
    if isinstance(token_request, TokenDetails):
        return token_request
    elif (isinstance(token_request, dict) and ('issued' in token_request)):
        return TokenDetails.from_dict(token_request)
    elif isinstance(token_request, dict):
        token_request = TokenRequest.from_json(token_request)
    elif isinstance(token_request, str):
        return TokenDetails(token=token_request)
    token_path = ('/keys/%s/requestToken' % token_request.key_name)
    response = (await self.ably.http.post(token_path, headers=auth_headers, body=token_request.to_dict(), skip_auth=True))
    AblyException.raise_for_response(response)
    response_dict = response.to_native()
    log.debug(('Token: %s' % str(response_dict.get('token'))))
    return TokenDetails.from_dict(response_dict)
async def request_token(self, token_params=None, key_name=None, key_secret=None, auth_callback=None, auth_url=None, auth_method=None, auth_headers=None, auth_params=None, query_time=None):
    token_params = (token_params or {})
    token_params = dict(self.auth_options.default_token_params, **token_params)
    key_name = (key_name or self.auth_options.key_name)
    key_secret = (key_secret or self.auth_options.key_secret)
    log.debug(('Auth callback: %s' % auth_callback))
    log.debug(('Auth options: %s' % self.auth_options))
    if (query_time is None):
        query_time = self.auth_options.query_time
    query_time = bool(query_time)
    auth_callback = (auth_callback or self.auth_options.auth_callback)
    auth_url = (auth_url or self.auth_options.auth_url)
    auth_params = (auth_params or self.auth_options.auth_params or {})
    auth_method = (auth_method or self.auth_options.auth_method).upper()
    auth_headers = (auth_headers or self.auth_options.auth_headers or {})
    log.debug(('Token Params: %s' % token_params))
    if auth_callback:
        log.debug('using token auth with authCallback')
        token_request = (await auth_callback(token_params))
    elif auth_url:
        log.debug('using token auth with authUrl')
        token_request = (await self.token_request_from_auth_url(auth_method, auth_url, token_params, auth_headers, auth_params))
    else:
        token_request = (await self.create_token_request(token_params, key_name=key_name, key_secret=key_secret, query_time=query_time))
    if isinstance(token_request, TokenDetails):
        return token_request
    elif (isinstance(token_request, dict) and ('issued' in token_request)):
        return TokenDetails.from_dict(token_request)
    elif isinstance(token_request, dict):
        token_request = TokenRequest.from_json(token_request)
    elif isinstance(token_request, str):
        return TokenDetails(token=token_request)
    token_path = ('/keys/%s/requestToken' % token_request.key_name)
    response = (await self.ably.http.post(token_path, headers=auth_headers, body=token_request.to_dict(), skip_auth=True))
    AblyException.raise_for_response(response)
    response_dict = response.to_native()
    log.debug(('Token: %s' % str(response_dict.get('token'))))
    return TokenDetails.from_dict(response_dict)