/**
  *
  *
  * @param ProfileController $Sender
  * @param type $UserReference
  * @param type $Username
  * @param type $Code
  */
 public function profileController_FacebookConnect_create($Sender, $UserReference, $Username, $Code = false)
 {
     $Sender->permission('Garden.SignIn.Allow');
     $Sender->getUserInfo($UserReference, $Username, '', true);
     $Sender->_setBreadcrumbs(t('Connections'), '/profile/connections');
     // Get the access token.
     $AccessToken = $this->getAccessToken($Code, self::profileConnecUrl());
     // Get the profile.
     $Profile = $this->getProfile($AccessToken);
     // Save the authentication.
     Gdn::userModel()->saveAuthentication(array('UserID' => $Sender->User->UserID, 'Provider' => self::ProviderKey, 'UniqueID' => $Profile['id']));
     // Save the information as attributes.
     $Attributes = array('AccessToken' => $AccessToken, 'Profile' => $Profile);
     Gdn::userModel()->saveAttribute($Sender->User->UserID, self::ProviderKey, $Attributes);
     $this->EventArguments['Provider'] = self::ProviderKey;
     $this->EventArguments['User'] = $Sender->User;
     $this->fireEvent('AfterConnection');
     redirect(userUrl($Sender->User, '', 'connections'));
 }