Пример #1
0
 public function getPrivateToken()
 {
     $this->init();
     if ($this->isConnected()) {
         /** @var TokenInterface $t */
         return $this->storage->retrieveAccessToken($this->getServiceName())->getRequestTokenSecret();
     } else {
         return false;
     }
 }
Пример #2
0
 /**
  * Set up the access tokens
  */
 public function fromInput(AbstractService $service = null)
 {
     if (null === $service && isset($this->service)) {
         $service = $this->service;
     } elseif (null === $service) {
         throw new Exception("An OAuth service is required", 1);
     }
     if (is_a($this->service, '\\OAuth\\OAuth1\\Service\\AbstractService')) {
         $token = $this->storage->retrieveAccessToken($service->service());
         $service->requestAccessToken(Input::get('oauth_token'), Input::get('oauth_verifier'), $token->getRequestTokenSecret());
     } elseif (is_a($this->service, '\\OAuth\\OAuth2\\Service\\AbstractService')) {
         $token = $service->requestAccessToken(Input::get('code'));
     }
     return $service;
 }