{"action":"created","issue":{"url":"https://api.github.com/repos/funcool/buddy/issues/15","labels_url":"https://api.github.com/repos/funcool/buddy/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/funcool/buddy/issues/15/comments","events_url":"https://api.github.com/repos/funcool/buddy/issues/15/events","html_url":"https://github.com/funcool/buddy/issues/15","id":48723137,"number":15,"title":"Token based auth","user":{"login":"LKay","id":181078,"avatar_url":"https://avatars.githubusercontent.com/u/181078?v=3","gravatar_id":"","url":"https://api.github.com/users/LKay","html_url":"https://github.com/LKay","followers_url":"https://api.github.com/users/LKay/followers","following_url":"https://api.github.com/users/LKay/following{/other_user}","gists_url":"https://api.github.com/users/LKay/gists{/gist_id}","starred_url":"https://api.github.com/users/LKay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LKay/subscriptions","organizations_url":"https://api.github.com/users/LKay/orgs","repos_url":"https://api.github.com/users/LKay/repos","events_url":"https://api.github.com/users/LKay/events{/privacy}","received_events_url":"https://api.github.com/users/LKay/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-11-14T02:36:43Z","updated_at":"2015-01-12T09:34:23Z","closed_at":"2015-01-11T16:22:59Z","body":"I tried to implement token based auth in my application but the token-backend does not work for some reason.\r\n\r\nI set up backend and handlers according to docs:\r\n\r\n    (defn authenticate\r\n      [req auth-data]\r\n      \"test\")\r\n\r\n    (def auth-backend\r\n      (token-backend {:authfn authenticate\r\n                      :unauthorized-handler unauthorized-handler}))\r\n\r\nAnd my request handler looks like:\r\n\r\n    (def api\r\n      (->\r\n        (handler/api api-routes)\r\n        (wrap-authentication auth/auth-backend)\r\n        (wrap-authorization auth/auth-backend)\r\n        (wrap-session)\r\n        (wrap-restful-response)))\r\n\r\nThe method ``authfn`` gets never called and I can't authenticate user in any way using buddy. Is this backend broken?\r\n"},"comment":{"url":"https://api.github.com/repos/funcool/buddy/issues/comments/69545695","html_url":"https://github.com/funcool/buddy/issues/15#issuecomment-69545695","issue_url":"https://api.github.com/repos/funcool/buddy/issues/15","id":69545695,"user":{"login":"Arcanum-XIII","id":412635,"avatar_url":"https://avatars.githubusercontent.com/u/412635?v=3","gravatar_id":"","url":"https://api.github.com/users/Arcanum-XIII","html_url":"https://github.com/Arcanum-XIII","followers_url":"https://api.github.com/users/Arcanum-XIII/followers","following_url":"https://api.github.com/users/Arcanum-XIII/following{/other_user}","gists_url":"https://api.github.com/users/Arcanum-XIII/gists{/gist_id}","starred_url":"https://api.github.com/users/Arcanum-XIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arcanum-XIII/subscriptions","organizations_url":"https://api.github.com/users/Arcanum-XIII/orgs","repos_url":"https://api.github.com/users/Arcanum-XIII/repos","events_url":"https://api.github.com/users/Arcanum-XIII/events{/privacy}","received_events_url":"https://api.github.com/users/Arcanum-XIII/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T09:34:23Z","updated_at":"2015-01-12T09:34:23Z","body":"@niwibe after double checking my code : yes, you're right. A typo, and some confusing behavior in lein ring headless push me into it. \r\nSo, everything is working as intended for me, be it signed-token or plain token."}}