Dashboard > ringside > ... > Cross Network Identity Mapping > Application Configuration Code for Mapping
Application Configuration Code for Mapping Log In | Sign Up   View a printable version of the current page.
<?php
  require_once 'ringside/api/clients/RingsideApiClients.php';
  require_once 'ringside/api/clients/RingsideApiClientsConfig.php';
  $appapikey = 'API_KEY';
  $appsecret = 'SECRET';
  // Configure URLs; MUST be done before creating RingsideApiClients
  // This is the Provider network (the one with the application directly registered)
  RingsideApiClientsConfig::$webUrl = 'http://provider:8888/web';
  RingsideApiClientsConfig::$serverUrl = 'http://provider:8888/api/restserver.php';
  RingsideApiClientsConfig::$socialUrl = 'http://provider:8888/social';

  // These are the Host networks; note that the social URL is only used for mapping
  if ( $_REQUEST['fb_sig_nid'] == 'TRUST_KEY_FOR_HOST_NETWORK_1') {
    RingsideApiClientsConfig::$webUrl = 'http://host1';
    RingsideApiClientsConfig::$serverUrl = 'http://host1/restserver.php';
  }

  $ringside = new RingsideApiClients($appapikey, $appsecret);

  // This line of code will require the user to have some registered identity
  $ringside->require_network_login();

  // Force all Ringside calls to go to the local API server with an
  // infinite session that we acquired before; this will help with identity mapping
  $ringside->api_client->addServer('ringsideidm', 'http://provider:8888/api/restserver.php', 'INFINITE_SESSION_KEY');
?>
Added by Jason Kinner , last edited by Jason Kinner on Apr 11, 2008  (view change)
Labels: 
(None)