/** * @param Request $request * @param ResourceOwnerInterface $resourceOwner * * @return string */ public function getServiceAuthUrl(Request $request, ResourceOwnerInterface $resourceOwner) { if ($resourceOwner->getOption('auth_with_one_url')) { $redirectUrl = $this->httpUtils->generateUri($request, $this->ownerMap->getResourceOwnerCheckPath($resourceOwner->getName())) . '?authenticated=true'; } else { $request->attributes->set('service', $resourceOwner->getName()); $redirectUrl = $this->httpUtils->generateUri($request, 'hwi_oauth_connect_service'); } return $redirectUrl; }
/** * Key to for fetching or saving a token. * * @param ResourceOwnerInterface $resourceOwner * @param mixed $tokenId * * @return string */ protected function generateKey(ResourceOwnerInterface $resourceOwner, $tokenId) { return implode('.', array('_hwi_oauth.request_token', $resourceOwner->getName(), $resourceOwner->getOption('client_id'), $tokenId)); }
/** * @param Request $request * @param ResourceOwnerInterface $resourceOwner * * @return string */ public function getServiceAuthUrl(Request $request, ResourceOwnerInterface $resourceOwner) { if ($resourceOwner->getOption('auth_with_one_url')) { return $this->httpUtils->generateUri($request, $this->getResourceOwnerCheckPath($resourceOwner->getName())); } $request->attributes->set('service', $resourceOwner->getName()); return $this->httpUtils->generateUri($request, 'hwi_oauth_connect_service'); }
/** * Key to for fetching or saving a token. * * @param ResourceOwnerInterface $resourceOwner * @param string $key * @param string $type * * @return string */ protected function generateKey(ResourceOwnerInterface $resourceOwner, $key, $type) { return sprintf('_hwi_oauth.%s.%s.%s.%s', $resourceOwner->getName(), $resourceOwner->getOption('client_id'), $type, $key); }