dongtiannai0654 2016-04-21 10:40
浏览 46
已采纳

使用FOSOAuthServerBundle的登录表单

I am trying to set up an OAuth server in Symfony using the FOSOAuthServerBundle bundle. However, I am getting the following error:

Client not found.

404 Not Found - NotFoundHttpException

As far as I can see in the source code, it is looking for a client somewhere. (See code below)

How do I provide it with that information in the form? I've tried putting in a hidden client_id field without any success.

$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.');
}
  • 写回答

1条回答 默认 最新

  • dongyuan1984 2016-04-25 09:33
    关注

    It's expected to be in the URL. This worked out for me:

    http://local.dev/oauth/v2/auth?client_id=1_123123123123

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan