예제 #1
0
 public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, SignatureInterface $signature, UriInterface $baseApiUri = null)
 {
     parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
     if (null === $baseApiUri) {
         $this->baseApiUri = new Uri('https://api.fitbit.com/1/');
     }
 }
예제 #2
0
 public function __construct(Credentials $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, SignatureInterface $signature, UriInterface $baseApiUri = null)
 {
     parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
     if (null === $baseApiUri) {
         $this->baseApiUri = new Uri('http://www.flickr.com/services/api/');
     }
 }
예제 #3
0
 public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, SignatureInterface $signature, UriInterface $baseApiUri = null)
 {
     parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
     if ($baseApiUri === null) {
         $this->baseApiUri = new Uri(BX_DOL_OAUTH_URL_BASE);
     }
 }
예제 #4
0
파일: Redmine.php 프로젝트: clee03/metal
 public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, SignatureInterface $signature, UriInterface $baseApiUri)
 {
     parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
     if (null === $baseApiUri) {
         throw new \Exception('baseApiUri is a required argument.');
     }
 }
예제 #5
0
파일: Flickr.php 프로젝트: nukeplus/nuke
 public function requestAccessToken($token, $verifier, $tokenSecret = null)
 {
     if (is_null($tokenSecret)) {
         /** @var TokenInterface $storedRequestToken */
         $storedRequestToken = $this->storage->retrieveAccessToken($this->service());
         $tokenSecret = $storedRequestToken->getAccessTokenSecret();
     }
     return parent::requestAccessToken($token, $verifier, $tokenSecret);
 }
 public function __construct(Credentials $credentials, ClientInterface $httpClient = null, TokenStorageInterface $storage = null, SignatureInterface $signature = null, UriInterface $baseApiUri = null)
 {
     if (!isset($httpClient)) {
         $httpClient = new \OAuth\Common\Http\Client\StreamClient();
     }
     if (!isset($storage)) {
         $storage = new \OAuth\Common\Storage\Session();
     }
     if (!isset($signature)) {
         $signature = new \OAuth\OAuth1\Signature\Signature($credentials);
     }
     parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
 }
예제 #7
0
 public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, SignatureInterface $signature, UriInterface $baseApiUri = null)
 {
     //This is a bit of a hack; but Not really sure what else todo.
     $signature = new SignatureRsaSha1($credentials);
     parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
     if (null === $baseApiUri) {
         $this->baseApiUri = new Uri('https://api.xero.com/api.xro/2.0/');
     }
     //Hack like a shit c**t.
     $a = new \OAuth\OAuth1\Token\StdOAuth1Token();
     $a->setAccessToken($this->credentials->getConsumerId());
     $a->setAccessTokenSecret($this->credentials->getConsumerSecret());
     $this->storage->storeAccessToken($this->service(), $a);
 }
예제 #8
0
 public function __construct(Credentials $credentials, ClientInterface $httpClient = null, TokenStorageInterface $storage = null, SignatureInterface $signature = null, UriInterface $baseApiUri = null)
 {
     if (!isset($httpClient)) {
         $httpClient = new \OAuth\Common\Http\Client\StreamClient();
         $httpClient->setTimeout(self::DEFAULT_TIMEOUT);
     }
     if (!isset($storage)) {
         $storage = new \OAuth\Common\Storage\Session();
     }
     if (!isset($signature)) {
         $signature = new \Magento\TestFramework\Authentication\Rest\OauthClient\Signature($credentials);
     }
     parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
 }
예제 #9
0
 /**
  * {@inheritDoc}
  */
 public function request($path, $method = 'GET', $body = null, array $extraHeaders = array())
 {
     $extraHeaders['Accept'] = 'application/json';
     return parent::request($path, $method, $body, $extraHeaders);
 }
예제 #10
0
 /**
  * {@inheritDoc}
  */
 public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, SignatureInterface $signature, UriInterface $baseApiUri = null, Service $service)
 {
     $this->service = $service;
     parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
 }