/**
  * Stores a negotiated consumer key and secret in the gadget store.
  * The "secret" can either be a consumer secret in the strict OAuth sense,
  * or it can be a PKCS8-then-Base64 encoded private key that we'll be using
  * with this service provider.
  *
  * @param gadgetUrl the URL of the gadget
  * @param serviceName the service provider with whom we have negotiated a
  *                    consumer key and secret.
  */
 public function storeConsumerKeyAndSecret($gadgetUrl, $serviceName, $keyAndSecret)
 {
     $providerKey = new ProviderKey();
     $providerKey->setGadgetUri($gadgetUrl);
     $providerKey->setServiceName($serviceName);
     $this->store->setOAuthConsumerKeyAndSecret($providerKey, $keyAndSecret);
 }
Пример #2
0
 public function getOAuthAccessorTokenKey(TokenKey $tokenKey, ProviderInfo $provInfo)
 {
     $provKey = new ProviderKey();
     $provKey->setGadgetUri($tokenKey->getGadgetUri());
     $provKey->setServiceName($tokenKey->getServiceName());
     //AccesorInfo
     $result = $this->getOAuthAccessorProviderKey($provKey, $provInfo);
     //TokenInfo
     $accessToken = $this->getTokenInfo($tokenKey);
     if ($accessToken != null) {
         // maybe convert into methods
         $result->getAccessor()->accessToken = $accessToken->getAccessToken();
         $result->getAccessor()->tokenSecret = $accessToken->getTokenSecret();
     }
     return $result;
 }