我正在尝试使用FOSOAuthServerBundle
捆绑包在Symfony中设置OAuth服务器。但是,我收到以下错误:
未找到客户。
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.');
}
答案 0 :(得分:0)
It's expected to be in the URL. This worked out for me: