/** * Get access token by another user (not current) * @param $userId * @return string */ protected function getAccessTokenByUserSocServ($userId) { $socGoogleOAuth = new CSocServLiveIDOAuth($userId); //this bug. SocServ fill entityOAuth in method getUrl..... $googleOAuthUrl = $socGoogleOAuth->getUrl('modal', CWebDavEditDocGoogle::$SCOPE); $accessToken = $socGoogleOAuth->getStorageToken(); return $accessToken; }
/** * Request and store access token (self::accessToken) for self::userId * @return $this */ public function queryAccessToken() { if (!Loader::includeModule('socialservices')) { $this->errorCollection->add(array(new Error(Loc::getMessage('DISK_ONEDRIVE_HANDLER_ERROR_NOT_INSTALLED_SOCSERV'), self::ERROR_NOT_INSTALLED_SOCSERV))); return false; } $socLiveIdOAuth = new \CSocServLiveIDOAuth($this->userId); //this bug. SocServ fill entityOAuth in method getUrl..... $socLiveIdOAuth->getUrl('modal', array('wl.contacts_skydrive', 'wl.skydrive_update', 'wl.skydrive')); $this->accessToken = $socLiveIdOAuth->getStorageToken(); return $this; }