def _AuthFacebookOrGoogleUser(tester, action, user_dict, ident_dict, device_dict, user_cookie):
  if device_dict is None:
    # Web client.
    url = tester.GetUrl('/%s/%s' % (action, ident_dict['authority'].lower()))
    response = _SendAuthRequest(tester, url, 'GET', user_cookie=user_cookie)
    assert response.code == 302, response.code

    # Invoke authentication again, this time sending code."""
    url = tester.GetUrl('/%s/%s?code=code' % (action, ident_dict['authority'].lower()))
    response = _SendAuthRequest(tester, url, 'GET', user_cookie=user_cookie)
    assert response.code == 302, response.code
    assert response.headers['location'].startswith('/view')
  else:
    if ident_dict['authority'] == 'Facebook':
      url = tester.GetUrl('/%s/facebook?access_token=access_token' % action)
    else:
      url = tester.GetUrl('/%s/google?refresh_token=refresh_token' % action)

    request_dict = _CreateRegisterRequest(device_dict)
    response = _SendAuthRequest(tester, url, 'POST', user_cookie=user_cookie, request_dict=request_dict)

  return response
Registers a user, identity, and device using the auth web service. The interface to Facebook
dataset/ETHPy150Open viewfinderco/viewfinder/backend/www/test/auth_test.py/_AuthFacebookOrGoogleUser