- Issue created by @dan612
Hello!
I was testing version 8.x-1.x-dev with a fresh Drupal 10 installation on PHP 8.2.5/8.1.18 and ran into the following error when visiting the configuration form route (/admin/config/people/alb_auth);
The website encountered an unexpected error. Try again later.
TypeError: Jose\Component\Signature\Serializer\CompactSerializer::unserialize(): Argument #1 ($input) must be of type string, null given, called in /app/docroot/modules/contrib/alb_auth/src/Claims/ALBClaimsExtractor.php on line 66 in Jose\Component\Signature\Serializer\CompactSerializer->unserialize() (line 56 of /app/vendor/web-token/jwt-framework/src/Component/Signature/Serializer/CompactSerializer.php).
Drupal\alb_auth\Claims\ALBClaimsExtractor->getClaimsFromToken(NULL) (Line: 47)
Drupal\alb_auth\Claims\ALBClaimsExtractor->getClaimsFromRequest(Object) (Line: 95)
Drupal\alb_auth\Form\ConfigurationForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('alb_auth_admin_settings', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
It appears that if the following header is missing from the request, X_AMZN_OIDC_DATA, then getClaimsFromToken() returns null, and then this error is thrown.
It would be a better experience if this had a graceful fallback, and more information on how to properly set things up for usage.
n/a
n/a
n/a
Active
1.0
Code