{"action":"created","issue":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSOAuthServerBundle/issues/299","labels_url":"https://api.github.com/repos/FriendsOfSymfony/FOSOAuthServerBundle/issues/299/labels{/name}","comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSOAuthServerBundle/issues/299/comments","events_url":"https://api.github.com/repos/FriendsOfSymfony/FOSOAuthServerBundle/issues/299/events","html_url":"https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/issues/299","id":61624393,"number":299,"title":"Gran Extension not working","user":{"login":"compains","id":8570898,"avatar_url":"https://avatars.githubusercontent.com/u/8570898?v=3","gravatar_id":"","url":"https://api.github.com/users/compains","html_url":"https://github.com/compains","followers_url":"https://api.github.com/users/compains/followers","following_url":"https://api.github.com/users/compains/following{/other_user}","gists_url":"https://api.github.com/users/compains/gists{/gist_id}","starred_url":"https://api.github.com/users/compains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compains/subscriptions","organizations_url":"https://api.github.com/users/compains/orgs","repos_url":"https://api.github.com/users/compains/repos","events_url":"https://api.github.com/users/compains/events{/privacy}","received_events_url":"https://api.github.com/users/compains/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-14T14:58:50Z","updated_at":"2015-03-15T06:36:41Z","closed_at":null,"body":"I have prepared a class for custom grant procedure that looks like\r\n\r\n````\r\n<?php\r\n\r\n\r\nnamespace AppBundle\\OAuth;\r\n\r\nuse FOS\\OAuthServerBundle\\Storage\\GrantExtensionInterface;\r\nuse OAuth2\\Model\\IOAuth2Client;\r\nuse Symfony\\Component\\DependencyInjection\\Container;\r\n\r\n/**\r\n * Class SocialGrantExtension\r\n * @package AppBundle\\OAuth\r\n */\r\nclass SocialGrantExtension implements GrantExtensionInterface{\r\n\r\n    /**\r\n     * @var Container\r\n     */\r\n    private $serviceContainer;\r\n\r\n    /**\r\n     * @param Container $userRepository\r\n     */\r\n    public function __construct(Container $serviceContainer)\r\n    {\r\n        $this->serviceContainer = $serviceContainer;\r\n    }\r\n\r\n    /*\r\n     * {@inheritdoc}\r\n     */\r\n    public function checkGrantExtension(IOAuth2Client $client, array $inputData, array $authHeaders)\r\n    {\r\n        /// look for user do some checks an  return it.\r\n    }\r\n\r\n}\r\n```\r\n\r\nthen I configure the extension like:\r\n\r\n```\r\noauth.social_oauth_grant:\r\n        class: AppBundle\\OAuth\\SocialGrantExtension\r\n        arguments: [@service_container]\r\n        tags:\r\n            - { name: fos_oauth_server.grant_extension, uri: \"http://somehost.net/custom_grant\" }\r\n\r\n```\r\n\r\nI have done some debug job and I'm pretty sure that:\r\n\r\n- The service is initialized on the compiler pass. I have dumped it while executing cache:clear\r\n- The  extensión is not available at the OAuthStorageClass when checkGrantExtension is called because grantExtensions array is empty.\r\n\r\nI make some calls to get the access_token with other grant types and they work properly but if y use this grant type i get:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/8570898/6652102/ef4c5cae-ca62-11e4-9e95-8bed1ee13255.png)\r\n\r\n¿Any advise?\r\n\r\nBy the way I'm not sure if this is the right place (if this is an issue), if not, sorry for the confusion and feel free to move it to the right place."},"comment":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSOAuthServerBundle/issues/comments/80878391","html_url":"https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/issues/299#issuecomment-80878391","issue_url":"https://api.github.com/repos/FriendsOfSymfony/FOSOAuthServerBundle/issues/299","id":80878391,"user":{"login":"Spomky","id":1091072,"avatar_url":"https://avatars.githubusercontent.com/u/1091072?v=3","gravatar_id":"","url":"https://api.github.com/users/Spomky","html_url":"https://github.com/Spomky","followers_url":"https://api.github.com/users/Spomky/followers","following_url":"https://api.github.com/users/Spomky/following{/other_user}","gists_url":"https://api.github.com/users/Spomky/gists{/gist_id}","starred_url":"https://api.github.com/users/Spomky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spomky/subscriptions","organizations_url":"https://api.github.com/users/Spomky/orgs","repos_url":"https://api.github.com/users/Spomky/repos","events_url":"https://api.github.com/users/Spomky/events{/privacy}","received_events_url":"https://api.github.com/users/Spomky/received_events","type":"User","site_admin":false},"created_at":"2015-03-15T06:36:41Z","updated_at":"2015-03-15T06:36:41Z","body":"Is your yaml file correctly loaded by your bundle extension?\r\n"}}