Error 500 Internal Server Error

GET https://unab.social/connect/check?error=access_deniedu0026error_subcode%3Dcancelu0026state%3D1750705049

Forwarded to ErrorController (39daa3)

Exceptions

Microsoft\Kiota\Authentication\Oauth\AuthorizationCodeContext::__construct(): Argument #4 ($authCode) must be of type string, null given, called in /home/unabsocial/app/src/Security/UnabAuthenticator.php on line 68

Exception

TypeError

  1. * @param string $clientSecret
  2. * @param string $authCode
  3. * @param string $redirectUri
  4. * @param array<string, string> $additionalParams
  5. */
  6. public function __construct(string $tenantId, string $clientId, string $clientSecret, string $authCode, string $redirectUri, array $additionalParams = [])
  7. {
  8. if (!$redirectUri) {
  9. throw new InvalidArgumentException('$authCode or $redirectUri cannot be empty.');
  10. }
  11. $this->authCode = $authCode;
AuthorizationCodeContext->__construct() in src/Security/UnabAuthenticator.php (line 68)
  1. // The auth provider will only authorize requests to
  2. // the allowed hosts, in this case Microsoft Graph
  3. $allowedHosts = ['graph.microsoft.com'];
  4. $scopes = ['User.Read'];
  5. $tokenRequestContext = new AuthorizationCodeContext(
  6. $tenantId,
  7. $this->clientId,
  8. $this->secretId,
  9. $authorizationCode,
  10. $redirectUri
  1. public function authenticate(Request $request): Passport
  2. {
  3. $startTime = microtime(true);
  4. try {
  5. $this->passport = $this->authenticator->authenticate($request);
  6. } finally {
  7. $this->duration = microtime(true) - $startTime;
  8. }
  9. return $this->passport;
  1. $passport = null;
  2. $previousToken = $this->tokenStorage->getToken();
  3. try {
  4. // get the passport from the Authenticator
  5. $passport = $authenticator->authenticate($request);
  6. // check the passport (e.g. password checking)
  7. $event = new CheckPassportEvent($authenticator, $passport);
  8. $this->eventDispatcher->dispatch($event);
  1. $this->logger?->debug('Skipping the "{authenticator}" authenticator as it did not support the request.', ['authenticator' => ($authenticator instanceof TraceableAuthenticator ? $authenticator->getAuthenticator() : $authenticator)::class]);
  2. continue;
  3. }
  4. $response = $this->executeAuthenticator($authenticator, $request);
  5. if (null !== $response) {
  6. $this->logger?->debug('The "{authenticator}" authenticator set the response. Any later authenticator will not be called', ['authenticator' => ($authenticator instanceof TraceableAuthenticator ? $authenticator->getAuthenticator() : $authenticator)::class]);
  7. return $response;
  8. }
  1. if (!$authenticators) {
  2. return null;
  3. }
  4. return $this->executeAuthenticators($authenticators, $request);
  5. }
  6. /**
  7. * @param AuthenticatorInterface[] $authenticators
  8. */
  1. }
  2. public function authenticate(RequestEvent $event): void
  3. {
  4. $request = $event->getRequest();
  5. $response = $this->authenticatorManager->authenticateRequest($request);
  6. if (null === $response) {
  7. return;
  8. }
  9. $event->setResponse($response);
  1. return $supports;
  2. }
  3. public function authenticate(RequestEvent $event): void
  4. {
  5. $this->authenticationManagerListener->authenticate($event);
  6. }
  7. public function getAuthenticatorManagerListener(): AuthenticatorManagerListener
  8. {
  9. return $this->authenticationManagerListener;
  1. public function authenticate(RequestEvent $event): void
  2. {
  3. $startTime = microtime(true);
  4. try {
  5. $this->listener->authenticate($event);
  6. } catch (LazyResponseException $e) {
  7. $this->response = $e->getResponse();
  8. throw $e;
  9. } finally {
  1. }
  2. }
  3. if (!$lazy) {
  4. foreach ($listeners as $listener) {
  5. $listener($event);
  6. if ($event->hasResponse()) {
  7. return;
  8. }
  9. }
  1. $requestListeners[] = $wrappedListener;
  2. }
  3. }
  4. foreach ($requestListeners as $listener) {
  5. $listener($event);
  6. if ($event->hasResponse()) {
  7. break;
  8. }
  9. }
in vendor/symfony/security-http/Firewall.php -> callListeners (line 92)
  1. if (null !== $logoutListener) {
  2. yield $logoutListener;
  3. }
  4. };
  5. $this->callListeners($event, $authenticationListeners());
  6. }
  7. /**
  8. * @return void
  9. */
  1. $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener);
  2. $e = $this->stopwatch->start($this->name, 'event_listener');
  3. try {
  4. ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
  5. } finally {
  6. if ($e->isStarted()) {
  7. $e->stop();
  8. }
  9. }
  1. foreach ($listeners as $listener) {
  2. if ($stoppable && $event->isPropagationStopped()) {
  3. break;
  4. }
  5. $listener($event, $eventName, $this);
  6. }
  7. }
  8. /**
  9. * Sorts the internal list of listeners for the given event by priority.
  1. } else {
  2. $listeners = $this->getListeners($eventName);
  3. }
  4. if ($listeners) {
  5. $this->callListeners($listeners, $eventName, $event);
  6. }
  7. return $event;
  8. }
  1. try {
  2. $this->beforeDispatch($eventName, $event);
  3. try {
  4. $e = $this->stopwatch->start($eventName, 'section');
  5. try {
  6. $this->dispatcher->dispatch($event, $eventName);
  7. } finally {
  8. if ($e->isStarted()) {
  9. $e->stop();
  10. }
  11. }
  1. */
  2. private function handleRaw(Request $request, int $type = self::MAIN_REQUEST): Response
  3. {
  4. // request
  5. $event = new RequestEvent($this, $request, $type);
  6. $this->dispatcher->dispatch($event, KernelEvents::REQUEST);
  7. if ($event->hasResponse()) {
  8. return $this->filterResponse($event->getResponse(), $request, $type);
  9. }
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  1. $this->boot();
  2. ++$this->requestStackSize;
  3. $this->resetServices = true;
  4. try {
  5. return $this->getHttpKernel()->handle($request, $type, $catch);
  6. } finally {
  7. --$this->requestStackSize;
  8. }
  9. }
  1. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. if (Kernel::VERSION_ID >= 60400) {
  7. $response->send(false);
  8. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 29)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/home/unabsocial/app/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5. return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Logs

Level Channel Message
INFO 12:15:15 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "1e597d"
    },
    "request_uri": "https://unab.social/_profiler/1e597d?panel=exception&type=request",
    "method": "GET"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener::configure"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\UX\Turbo\Request\RequestListener::__invoke".
{
    "event": "kernel.request",
    "listener": "Symfony\\UX\\Turbo\\Request\\RequestListener::__invoke"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener::onKernelRequest"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Bridge\Doctrine\Middleware\IdleConnection\Listener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bridge\\Doctrine\\Middleware\\IdleConnection\\Listener::onKernelRequest"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\SessionListener::onKernelRequest"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::setDefaultLocale".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::setDefaultLocale"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Component\AssetMapper\AssetMapperDevServerSubscriber::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\AssetMapper\\AssetMapperDevServerSubscriber::onKernelRequest"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\RouterListener::onKernelRequest"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::onKernelRequest"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleAwareListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleAwareListener::onKernelRequest"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::configureLogoutUrlGenerator".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bundle\\SecurityBundle\\Debug\\TraceableFirewallListener::configureLogoutUrlGenerator"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bundle\\SecurityBundle\\Debug\\TraceableFirewallListener::onKernelRequest"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber::onKernelRequestPrettyUrls".
{
    "event": "kernel.request",
    "listener": "EasyCorp\\Bundle\\EasyAdminBundle\\EventListener\\AdminRouterSubscriber::onKernelRequestPrettyUrls"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "EasyCorp\\Bundle\\EasyAdminBundle\\EventListener\\AdminRouterSubscriber::onKernelRequest"
}
DEBUG 12:15:15 event Notified event "kernel.request" to listener "Symfony\UX\LiveComponent\EventListener\LiveComponentSubscriber::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\UX\\LiveComponent\\EventListener\\LiveComponentSubscriber::onKernelRequest"
}
DEBUG 12:15:15 event Notified event "kernel.controller" to listener "EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber::onKernelController".
{
    "event": "kernel.controller",
    "listener": "EasyCorp\\Bundle\\EasyAdminBundle\\EventListener\\AdminRouterSubscriber::onKernelController"
}
DEBUG 12:15:15 event Notified event "kernel.controller" to listener "Symfony\UX\LiveComponent\EventListener\LiveComponentSubscriber::onKernelController".
{
    "event": "kernel.controller",
    "listener": "Symfony\\UX\\LiveComponent\\EventListener\\LiveComponentSubscriber::onKernelController"
}
DEBUG 12:15:15 event Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController".
{
    "event": "kernel.controller",
    "listener": "Symfony\\Bundle\\FrameworkBundle\\DataCollector\\RouterDataCollector::onKernelController"
}
DEBUG 12:15:15 event Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController".
{
    "event": "kernel.controller",
    "listener": "Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector::onKernelController"
}
DEBUG 12:15:15 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\Security\Http\EventListener\IsCsrfTokenValidAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\Security\\Http\\EventListener\\IsCsrfTokenValidAttributeListener::onKernelControllerArguments"
}
DEBUG 12:15:15 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\Security\Http\EventListener\IsGrantedAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\Security\\Http\\EventListener\\IsGrantedAttributeListener::onKernelControllerArguments"
}
DEBUG 12:15:15 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\CacheAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\CacheAttributeListener::onKernelControllerArguments"
}
DEBUG 12:15:15 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestPayloadValueResolver::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestPayloadValueResolver::onKernelControllerArguments"
}
DEBUG 12:15:15 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\ErrorListener::onControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\ErrorListener::onControllerArguments"
}

Stack Trace

TypeError
TypeError:
Microsoft\Kiota\Authentication\Oauth\AuthorizationCodeContext::__construct(): Argument #4 ($authCode) must be of type string, null given, called in /home/unabsocial/app/src/Security/UnabAuthenticator.php on line 68

  at vendor/microsoft/kiota-authentication-phpleague/src/Oauth/AuthorizationCodeContext.php:48
  at Microsoft\Kiota\Authentication\Oauth\AuthorizationCodeContext->__construct()
     (src/Security/UnabAuthenticator.php:68)
  at App\Security\UnabAuthenticator->authenticate()
     (vendor/symfony/security-http/Authenticator/Debug/TraceableAuthenticator.php:74)
  at Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticator->authenticate()
     (vendor/symfony/security-http/Authentication/AuthenticatorManager.php:185)
  at Symfony\Component\Security\Http\Authentication\AuthenticatorManager->executeAuthenticator()
     (vendor/symfony/security-http/Authentication/AuthenticatorManager.php:167)
  at Symfony\Component\Security\Http\Authentication\AuthenticatorManager->executeAuthenticators()
     (vendor/symfony/security-http/Authentication/AuthenticatorManager.php:149)
  at Symfony\Component\Security\Http\Authentication\AuthenticatorManager->authenticateRequest()
     (vendor/symfony/security-http/Firewall/AuthenticatorManagerListener.php:38)
  at Symfony\Component\Security\Http\Firewall\AuthenticatorManagerListener->authenticate()
     (vendor/symfony/security-http/Authenticator/Debug/TraceableAuthenticatorManagerListener.php:58)
  at Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticatorManagerListener->authenticate()
     (vendor/symfony/security-bundle/Debug/WrappedLazyListener.php:46)
  at Symfony\Bundle\SecurityBundle\Debug\WrappedLazyListener->authenticate()
     (vendor/symfony/security-bundle/Security/LazyFirewallContext.php:61)
  at Symfony\Bundle\SecurityBundle\Security\LazyFirewallContext->__invoke()
     (vendor/symfony/security-bundle/Debug/TraceableFirewallListener.php:91)
  at Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener->callListeners()
     (vendor/symfony/security-http/Firewall.php:92)
  at Symfony\Component\Security\Http\Firewall->onKernelRequest()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:115)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:206)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:56)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:126)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:159)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:182)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/home/unabsocial/app/vendor/autoload_runtime.php')
     (public/index.php:5)