1
我试图在Symfony中使用FOSOAuthServerBundle
捆绑软件设置OAuth服务器。但是,我收到以下错误:使用FOSOAuthServerBundle的登录表单
Client not found.
404 Not Found - NotFoundHttpException
据我可以在源代码中看到,它正在寻找客户端的地方。 (请参阅下面的代码)
如何在表单中提供该信息?我试过在隐藏的client_id
领域没有任何成功。
$request = $this->getCurrentRequest();
$client = null;
if (null !== $request) {
if (null === $clientId = $request->get('client_id')) {
$form = $this->container->get('fos_oauth_server.authorize.form');
$formData = $request->get($form->getName(), array());
$clientId = isset($formData['client_id']) ? $formData['client_id'] : null;
}
$client = $this->container
->get('fos_oauth_server.client_manager')
->findClientByPublicId($clientId);
}
if (null === $client) {
throw new NotFoundHttpException('Client not found.');
}