{"action":"created","issue":{"url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/862","repository_url":"https://api.github.com/repos/simplabs/ember-simple-auth","labels_url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/862/labels{/name}","comments_url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/862/comments","events_url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/862/events","html_url":"https://github.com/simplabs/ember-simple-auth/issues/862","id":127963782,"number":862,"title":"Support accessing request options from custom authorizer","user":{"login":"eduardoweiland","id":1799015,"avatar_url":"https://avatars.githubusercontent.com/u/1799015?v=3","gravatar_id":"","url":"https://api.github.com/users/eduardoweiland","html_url":"https://github.com/eduardoweiland","followers_url":"https://api.github.com/users/eduardoweiland/followers","following_url":"https://api.github.com/users/eduardoweiland/following{/other_user}","gists_url":"https://api.github.com/users/eduardoweiland/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardoweiland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardoweiland/subscriptions","organizations_url":"https://api.github.com/users/eduardoweiland/orgs","repos_url":"https://api.github.com/users/eduardoweiland/repos","events_url":"https://api.github.com/users/eduardoweiland/events{/privacy}","received_events_url":"https://api.github.com/users/eduardoweiland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-21T16:31:09Z","updated_at":"2016-02-25T20:44:39Z","closed_at":null,"body":"When implementing a custom authorizer, sometimes it may be necessary to have access to the request data. An example is when accessing a [HMAC-secured API](http://www.9bitstudios.com/2013/07/hmac-rest-api-security/), in which case the request data must be hashed and the resulting hash is used to authorize the request.\r\n\r\nCurrently, the authorizer is called only with the session data and a callback function that adds the header to the request in the [session service](https://github.com/simplabs/ember-simple-auth/blob/49edaa18e4860acf0d355badcae6d797bd18dc2b/addon/services/session.js#L224). The [callback function](https://github.com/simplabs/ember-simple-auth/blob/49edaa18e4860acf0d355badcae6d797bd18dc2b/addon/mixins/data-adapter-mixin.js#L78) is passed from the DataAdapterMixin to the authorizer.\r\n\r\nA possible workaround is to override ajaxOptions() and, instead of passing a callback function, pass an object with the request data and the callback function. But it will be nice to have a standard way to access the request data from the authorizer."},"comment":{"url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/comments/188976601","html_url":"https://github.com/simplabs/ember-simple-auth/issues/862#issuecomment-188976601","issue_url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/862","id":188976601,"user":{"login":"marcoow","id":1510,"avatar_url":"https://avatars.githubusercontent.com/u/1510?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoow","html_url":"https://github.com/marcoow","followers_url":"https://api.github.com/users/marcoow/followers","following_url":"https://api.github.com/users/marcoow/following{/other_user}","gists_url":"https://api.github.com/users/marcoow/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoow/subscriptions","organizations_url":"https://api.github.com/users/marcoow/orgs","repos_url":"https://api.github.com/users/marcoow/repos","events_url":"https://api.github.com/users/marcoow/events{/privacy}","received_events_url":"https://api.github.com/users/marcoow/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T20:44:39Z","updated_at":"2016-02-25T20:44:39Z","body":"see #870 "}}