I am really lost trying to configure FOSOAuthServerBundle.
I think I have correctly installed it. Actually, I have created a command for registering new Clients. I have added one, but when I go to oauth/v2/auth with the required data, I get errors and errors. Now, I am in one really stopped:
Fatal error: Call to a member function isAuthorizedClient() on a non-object in /Users/pgbonino/Sites/Symfony/vendor/bundles/FOS/OAuthServerBundle/Controller/AuthorizeController.php on line 62
The exact line is the one with the if sentence:
$event = $this->container->get('event_dispatcher')->dispatch(
OAuthEvent::PRE_AUTHORIZATION_PROCESS,
new OAuthEvent($user, $this->getClient())
);
if ($event->isAuthorizedClient()) {
$scope = $this->container->get('request')->get('scope', null);
return $this->container
->get('fos_oauth_server.server')
->finishClientAuthorization(true, $user, null, $scope);
}
Previously I have had other errors, but I think they are solved thanks to forums, documentation and issues. But now I am stopped here.
Any clue on this?
I found also this solved issue in the bundle that seems to be related. But still not able to solve mine: https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/pull/46
Thanks a lot.
Solved!
It was a matter of differences between Symfony 2.0 and 2.1 on the treatment they do with dispatchers.
I had downloaded a Symfony2.1 version of FOSAUthServerBundle in Symfony2.0 environment.
It’s well explained in several issues of the bundle itself.