include_once \dirname(__DIR__, 4).'/vendor/hwi/oauth-bundle/OAuth/ResourceOwnerInterface.php';
include_once \dirname(__DIR__, 4).'/vendor/hwi/oauth-bundle/OAuth/ResourceOwner/AbstractResourceOwner.php';
include_once \dirname(__DIR__, 4).'/vendor/hwi/oauth-bundle/OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php';
include_once \dirname(__DIR__, 4).'/vendor/hwi/oauth-bundle/OAuth/ResourceOwner/GoogleResourceOwner.php';
return $container->services['hwi_oauth.resource_owner.google'] = new \HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\GoogleResourceOwner(($container->privates['hwi_oauth.http_client'] ?? $container->load('getHwiOauth_HttpClientService')), ($container->privates['security.http_utils'] ?? $container->load('getSecurity_HttpUtilsService')), ['client_id' => $container->getEnv('GOOGLE_ID'), 'client_secret' => $container->getEnv('GOOGLE_SECRET'), 'scope' => 'https://www.googleapis.com/auth/userinfo.profile', 'paths' => ['email' => 'email', 'profilepicture' => 'picture'], 'options' => ['access_type' => 'offline']], 'google', ($container->privates['hwi_oauth.storage.session'] ?? $container->load('getHwiOauth_Storage_SessionService')));
}
}
$this->loading[$id] = true;
try {
if (isset($this->fileMap[$id])) {
return /* self::IGNORE_ON_UNINITIALIZED_REFERENCE */ 4 === $invalidBehavior ? null : $this->load($this->fileMap[$id]);
} elseif (isset($this->methodMap[$id])) {
return /* self::IGNORE_ON_UNINITIALIZED_REFERENCE */ 4 === $invalidBehavior ? null : $this->{$this->methodMap[$id]}();
}
} catch (\Exception $e) {
unset($this->services[$id]);
*/
public function get($id, int $invalidBehavior = /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1)
{
return $this->services[$id]
?? $this->services[$id = $this->aliases[$id] ?? $id]
?? ('service_container' === $id ? $this : ($this->factories[$id] ?? [$this, 'make'])($id, $invalidBehavior));
}
/**
* Creates a service.
*
*
* @return string
*/
public function getAuthorizationUrl(Request $request, $name, $redirectUrl = null, array $extraParameters = [])
{
$resourceOwner = $this->getResourceOwner($name);
if (null === $redirectUrl) {
if (!$this->connect || !$this->authorizationChecker->isGranted($this->grantRule)) {
$redirectUrl = $this->httpUtils->generateUri($request, $this->getResourceOwnerCheckPath($name));
} else {
* @return RedirectResponse
*/
public function redirectToServiceAction(Request $request, $service): RedirectResponse
{
try {
$authorizationUrl = $this->oauthUtils->getAuthorizationUrl($request, $service);
} catch (RuntimeException $e) {
throw new NotFoundHttpException($e->getMessage(), $e);
}
$this->storeReturnPath($request, $authorizationUrl);
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
public function handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
EnvNotFoundException |
---|
Symfony\Component\DependencyInjection\Exception\EnvNotFoundException: Environment variable not found: "GOOGLE_ID". at vendor/symfony/dependency-injection/EnvVarProcessor.php:171 at Symfony\Component\DependencyInjection\EnvVarProcessor->getEnv('string', 'GOOGLE_ID', object(Closure)) (vendor/symfony/dependency-injection/Container.php:415) at Symfony\Component\DependencyInjection\Container->getEnv('GOOGLE_ID') (var/cache/dev/Container1RjsLXG/getHwiOauth_ResourceOwner_GoogleService.php:25) at Container1RjsLXG\getHwiOauth_ResourceOwner_GoogleService::do(object(App_KernelDevDebugContainer), true) (var/cache/dev/Container1RjsLXG/App_KernelDevDebugContainer.php:222) at Container1RjsLXG\App_KernelDevDebugContainer->load('getHwiOauth_ResourceOwner_GoogleService.php') (vendor/symfony/dependency-injection/Container.php:246) at Symfony\Component\DependencyInjection\Container->make('hwi_oauth.resource_owner.google', 1) (vendor/symfony/dependency-injection/Container.php:228) at Symfony\Component\DependencyInjection\Container->get('hwi_oauth.resource_owner.google') (vendor/hwi/oauth-bundle/Security/Http/ResourceOwnerMap.php:89) at HWI\Bundle\OAuthBundle\Security\Http\ResourceOwnerMap->getResourceOwnerByName('google') (vendor/hwi/oauth-bundle/Security/OAuthUtils.php:274) at HWI\Bundle\OAuthBundle\Security\OAuthUtils->getResourceOwner('google') (vendor/hwi/oauth-bundle/Security/OAuthUtils.php:107) at HWI\Bundle\OAuthBundle\Security\OAuthUtils->getAuthorizationUrl(object(Request), 'google') (vendor/hwi/oauth-bundle/Controller/RedirectToServiceController.php:78) at HWI\Bundle\OAuthBundle\Controller\RedirectToServiceController->redirectToServiceAction(object(Request), 'google') (vendor/symfony/http-kernel/HttpKernel.php:157) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:79) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:195) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (public/index.php:20) |