I tried to use this extension to work with drupal module as follow.
Drupal 7 , Oauth2 Server Module (https://www.drupal.org/project/oauth2_server)
However I keep getting error after I login at drupal and Accept authorization.
Can anyone help me to solve this problem, thanks.
I read few posts that has similar problems, but I don't know how to check the response content from oauth server.
Here are the error message I got from flarum logs.
[2022-05-14 03:58:45] flarum.ERROR: TypeError: Argument 2 passed to Flarum\Forum\Auth\ResponseFactory::make() must be of the type string, null given, called in /home/stl/public_html/flarum/vendor/fof/passport/src/Controllers/PassportController.php on line 94 and defined in /home/stl/public_html/flarum/vendor/flarum/core/src/Forum/Auth/ResponseFactory.php:36
Stack trace:
#0 /home/stl/public_html/flarum/vendor/fof/passport/src/Controllers/PassportController.php(94): Flarum\Forum\Auth\ResponseFactory->make('passport', NULL, Object(Closure))
#1 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/RouteHandlerFactory.php(41): FoF\Passport\Controllers\PassportController->handle(Object(Laminas\Diactoros\ServerRequest))
#2 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}(Object(Laminas\Diactoros\ServerRequest), Array)
#3 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ExecuteRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Closure))
#4 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/ContentTypeOptionsHeader.php(21): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#5 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ContentTypeOptionsHeader->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#6 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/ReferrerPolicyHeader.php(30): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#7 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ReferrerPolicyHeader->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#8 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/FlarumPromotionHeader.php(30): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#9 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\FlarumPromotionHeader->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#10 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/ShareErrorsFromSession.php(57): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#11 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ShareErrorsFromSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#12 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(36): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#13 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\CheckCsrfToken->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#14 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#15 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ResolveRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#16 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#17 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\SetLocale->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#18 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#19 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#20 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#21 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\RememberFromCookie->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#22 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#23 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\StartSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#24 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/CollectGarbage.php(46): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#25 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\CollectGarbage->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#26 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#27 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ParseJsonBody->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#28 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#29 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\HandleErrors->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#30 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#31 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\InjectActorReference->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#32 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#33 /home/stl/public_html/flarum/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#34 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\RequestHandler->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#35 /home/stl/public_html/flarum/vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#36 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePathRouter->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#37 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#38 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Laminas\Stratigility\Middleware\OriginalMessages->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#39 /home/stl/public_html/flarum/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#40 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePath->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#41 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#42 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ProcessIp->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#43 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#44 /home/stl/public_html/flarum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(65): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\EmptyPipelineHandler))
#45 /home/stl/public_html/flarum/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle(Object(Laminas\Diactoros\ServerRequest))
#46 /home/stl/public_html/flarum/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#47 /home/stl/public_html/flarum/public/index.php(26): Flarum\Http\Server->listen()
#48 {main}