Ejemplo n.º 1
0
 /**
  * @param AuthorizationRequestInterface $authorization
  * @throws InvalidArgumentException
  */
 public function buildAuthorizationRequestUri(AuthorizationRequestAwareGrantInterface $grant)
 {
     $authorizationEndpointUri = $this->config->getAuthorizationEndpointUri();
     Assertion::notNull($authorizationEndpointUri, 'Authorization endpoint uri is required to build authorization request uri.');
     $request = $grant->getAuthorizationRequest();
     $request->setClientId($this->config->getClientId());
     $query = http_build_query($request->getQueryParameters());
     return "{$authorizationEndpointUri}?{$query}";
 }
 protected function getBasicAuth()
 {
     $userId = $this->config->getClientId();
     $password = $this->config->getClientSecret();
     return "Basic " . base64_encode("{$userId}:{$password}");
 }