Civicm change UFID to ContactID relationship programatically
Well as usual it turns out to be simple.  I just need to manually make the link in civicrm_uf_match via my program then simply change the session variables via:

require_once 'administrator/components/com_civicrm/civicrm.settings.php';
   require_once 'administrator/components/com_civicrm/civicrm/CRM/Core/Config.php';
   require_once 'administrator/components/com_civicrm/civicrm/api/v3/UFMatch.php';
   require_once 'administrator/components/com_civicrm/civicrm.settings.php';
   require_once('CRM/Core/DAO.php');

$session = CRM_Core_Session::singleton();

$session-&gt;set('ufID' , $ufid);     //joomla ID
$session-&gt;set('userID' , $userid); //civi contact id