2
votes

I am trying to use FOSOAuthServerBundle, everything is OK. I can authentificate an user with oauth/v2/auth BUT, if the username and password are good, I have this error message:

Client not found.
404 Not Found - NotFoundHttpException

Stack Trace in /var/www/www.billtrackapp.com/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Controller/AuthorizeController.php at line 138
->findClientByPublicId($clientId); if (null === $client) { throw new NotFoundHttpException('Client not found.'); } $this->client = $client;

Hope you can help me on this issue.

Thanks.

1
I saw on Github that you found your issue. Could you please share the solution? I am having the same problem as you. - ornj
Same issue. Could you please share the solution? - elachance
Could you pls share your client.orm ? - Nisam
@Sebastien Thiebaud How did you solve this issue ? - Hunt

1 Answers

0
votes

Well, i dont know if this is your case but mine was in the namespace. You need to see if your client is in the Entity-s folder or Model-folder and depends on the implementation you are doing. Hope this helps. My Client code:

    <?php

    // src/Azimut/ApiBundle/Entity/Client.php

    namespace Azimut\ApiBundle\Entity;

    use FOS\OAuthServerBundle\Entity\Client as BaseClient;
    use Doctrine\ORM\Mapping as ORM;

    /**
     * @ORM\Entity
     */
    class Client extends BaseClient
    {
     /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue(strategy="AUTO")
       */
        protected $id;

        public function __construct()
        {
            parent::__construct();

        }

        /**
         * Get id
         *
         * @return integer 
         */
        public function getId()
        {
            return $this->id;
        }
    }