def _GenerateAccessToken(action, tester, device_dict, auth_info_dict, user_cookie=None, use_short_token=True):
 version = (message.MAX_SUPPORTED_MESSAGE_VERSION if use_short_token else message.Message.SUPPRESS_AUTH_NAME)
 url = tester.GetUrl(('/%s/viewfinder' % action))
 request_dict = auth_test._CreateRegisterRequest(device_dict, auth_info_dict, version=version)
 response = auth_test._SendAuthRequest(tester, url, 'POST', user_cookie=user_cookie, request_dict=request_dict)
 return json.loads(response.body)

def _GenerateAccessToken ( action , tester , device_dict , auth_info_dict , user_cookie = None , use_short_token = True ) : version = ( message . MAX_SUPPORTED_MESSAGE_VERSION if use_short_token else message . Message . SUPPRESS_AUTH_NAME ) url = tester . GetUrl ( ( '/%s/viewfinder' % action ) ) request_dict = auth_test . _CreateRegisterRequest ( device_dict , auth_info_dict , version = version ) response = auth_test . _SendAuthRequest ( tester , url , 'POST' , user_cookie = user_cookie , request_dict = request_dict ) return json . loads ( response . body )
sends a request to the viewfinder auth service .