Problem/Motivation
When using OAuth Authorization Code Flow to login to Drupal, after successful login the following warning is shown in the drupal ui:
Warning: Cannot modify header information - headers already sent by (output started at /opt/drupal/vendor/symfony/http-foundation/Response.php:368) in Drupal\miniorange_oauth_client\Controller\miniorange_oauth_clientController->miniorange_oauth_client_mo_login() (line 231 of modules/contrib/miniorange_oauth_client/src/Controller/miniorange_oauth_clientController.php).
Drupal\miniorange_oauth_client\Controller\miniorange_oauth_clientController->miniorange_oauth_client_mo_login()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
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: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
This issue is new since version 4.0.6, on version 4.0.5 it didn't occur.
Our setup is as follows:
Drupal version: 9.5.9
PHP version: 8.0
( Docker image: https://hub.docker.com/layers/library/drupal/9.5.9-php8.0-fpm-alpine3.16... )
Steps to reproduce
1. Login via SSO with external identity provider
2. The warning is shown as seen in the screenshot
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes