{"action":"opened","issue":{"url":"https://api.github.com/repos/bedita/bedita/issues/734","labels_url":"https://api.github.com/repos/bedita/bedita/issues/734/labels{/name}","comments_url":"https://api.github.com/repos/bedita/bedita/issues/734/comments","events_url":"https://api.github.com/repos/bedita/bedita/issues/734/events","html_url":"https://github.com/bedita/bedita/issues/734","id":102153329,"number":734,"title":"API: introduce a simple way to use custom auth component","user":{"login":"batopa","id":1306319,"avatar_url":"https://avatars.githubusercontent.com/u/1306319?v=3","gravatar_id":"","url":"https://api.github.com/users/batopa","html_url":"https://github.com/batopa","followers_url":"https://api.github.com/users/batopa/followers","following_url":"https://api.github.com/users/batopa/following{/other_user}","gists_url":"https://api.github.com/users/batopa/gists{/gist_id}","starred_url":"https://api.github.com/users/batopa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batopa/subscriptions","organizations_url":"https://api.github.com/users/batopa/orgs","repos_url":"https://api.github.com/users/batopa/repos","events_url":"https://api.github.com/users/batopa/events{/privacy}","received_events_url":"https://api.github.com/users/batopa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bedita/bedita/labels/Priority%20-%20High","name":"Priority - High","color":"ffee00"},{"url":"https://api.github.com/repos/bedita/bedita/labels/Topic%20-%20API","name":"Topic - API","color":"DDDDDD"},{"url":"https://api.github.com/repos/bedita/bedita/labels/Type%20-%20Enhancement","name":"Type - Enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"batopa","id":1306319,"avatar_url":"https://avatars.githubusercontent.com/u/1306319?v=3","gravatar_id":"","url":"https://api.github.com/users/batopa","html_url":"https://github.com/batopa","followers_url":"https://api.github.com/users/batopa/followers","following_url":"https://api.github.com/users/batopa/following{/other_user}","gists_url":"https://api.github.com/users/batopa/gists{/gist_id}","starred_url":"https://api.github.com/users/batopa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batopa/subscriptions","organizations_url":"https://api.github.com/users/batopa/orgs","repos_url":"https://api.github.com/users/batopa/repos","events_url":"https://api.github.com/users/batopa/events{/privacy}","received_events_url":"https://api.github.com/users/batopa/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/bedita/bedita/milestones/12","html_url":"https://github.com/bedita/bedita/milestones/3-stable","labels_url":"https://api.github.com/repos/bedita/bedita/milestones/12/labels","id":633090,"number":12,"title":"3-stable","description":"branch: 3-corylus\r\n\r\nfixes and minor features for 3-corylus","creator":{"login":"stefanorosanelli","id":2122280,"avatar_url":"https://avatars.githubusercontent.com/u/2122280?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanorosanelli","html_url":"https://github.com/stefanorosanelli","followers_url":"https://api.github.com/users/stefanorosanelli/followers","following_url":"https://api.github.com/users/stefanorosanelli/following{/other_user}","gists_url":"https://api.github.com/users/stefanorosanelli/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanorosanelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanorosanelli/subscriptions","organizations_url":"https://api.github.com/users/stefanorosanelli/orgs","repos_url":"https://api.github.com/users/stefanorosanelli/repos","events_url":"https://api.github.com/users/stefanorosanelli/events{/privacy}","received_events_url":"https://api.github.com/users/stefanorosanelli/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":138,"state":"open","created_at":"2014-04-17T15:40:04Z","updated_at":"2015-08-20T14:35:26Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-08-20T14:35:26Z","updated_at":"2015-08-20T14:35:26Z","closed_at":null,"body":"We need a simple way to change the default `ApiAuth` Component usually used without changing the component name in methods of `ApiBaseController`.\r\n\r\nWe could replace `ApiBaseController::$ApiAuth` with the instance of custom component defining the component used for authentication in conf.\r\n\r\nFor example the custom component named 'MyAuth' should to be added to self::$components\r\n\r\n ```php\r\n public $components = array(\r\n     'ResponseHandler' => array('type' => 'json'),\r\n     'MyAuth',\r\n     'ApiFormatter',\r\n     'ApiValidator'\r\n );\r\n ```\r\n\r\n and activated via conf\r\n\r\n ```php\r\n $config['api'] = array(\r\n     'baseUrl' => '/api',\r\n     'auth' => array(\r\n         'component' => 'MyAuth'\r\n     ),\r\n     ...\r\n );\r\n ```"}}