{"action":"opened","issue":{"url":"https://api.github.com/repos/zfcampus/zf-oauth2/issues/130","repository_url":"https://api.github.com/repos/zfcampus/zf-oauth2","labels_url":"https://api.github.com/repos/zfcampus/zf-oauth2/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/zfcampus/zf-oauth2/issues/130/comments","events_url":"https://api.github.com/repos/zfcampus/zf-oauth2/issues/130/events","html_url":"https://github.com/zfcampus/zf-oauth2/issues/130","id":133113255,"number":130,"title":"Question on protecting an API using AbstractRestfulController with OAuth2","user":{"login":"humphrey09","id":13730761,"avatar_url":"https://avatars.githubusercontent.com/u/13730761?v=3","gravatar_id":"","url":"https://api.github.com/users/humphrey09","html_url":"https://github.com/humphrey09","followers_url":"https://api.github.com/users/humphrey09/followers","following_url":"https://api.github.com/users/humphrey09/following{/other_user}","gists_url":"https://api.github.com/users/humphrey09/gists{/gist_id}","starred_url":"https://api.github.com/users/humphrey09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphrey09/subscriptions","organizations_url":"https://api.github.com/users/humphrey09/orgs","repos_url":"https://api.github.com/users/humphrey09/repos","events_url":"https://api.github.com/users/humphrey09/events{/privacy}","received_events_url":"https://api.github.com/users/humphrey09/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-11T23:16:36Z","updated_at":"2016-02-11T23:16:36Z","closed_at":null,"body":"I've finally managed securing my controller (extending the AuthController class) as mentioned in the documentation ( https://github.com/zfcampus/zf-oauth2#how-to-protect-your-api-using-oauth2 ) :\r\n\r\n```\r\nclass MyTestController extends AuthController {\r\n\t\r\n\t...\r\n\t\r\n\tpublic function __construct($serverFactory, UserIdProviderInterface $userIdProvider) {\r\n\r\n\t\tparent::__construct($serverFactory, $userIdProvider);\r\n\t}\r\n\t\r\n\tpublic function onDispatch(\\Zend\\Mvc\\MvcEvent $e) {\r\n\r\n\t\t$server = call_user_func($this->serverFactory, \"oauth\");\r\n\t\t\r\n\t\tif (!$server->verifyResourceRequest($this->getOAuth2Request())) {\r\n\r\n\t\t\t$response = $server->getResponse();\r\n\t\t\treturn $this->getApiProblemResponse($response);\r\n\t\t}\r\n\r\n\t\treturn parent::onDispatch($e);\r\n\t}\r\n\t\r\n\t...\r\n\t\r\n```\r\nAs my API is RESTful, I would like to use the AbstractRestfulController as base for my controller. Could you please give me a hint/code example, how to secure a controller which extends the AbstractRestfulController? I have not found any useful information so far regarding this topic (and as I'm still quite new to ZF2, there's a lot to learn).\r\n\r\nAny help would be greatly appreciated!"}}