{"action":"opened","issue":{"url":"https://api.github.com/repos/flarum/core/issues/250","labels_url":"https://api.github.com/repos/flarum/core/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/flarum/core/issues/250/comments","events_url":"https://api.github.com/repos/flarum/core/issues/250/events","html_url":"https://github.com/flarum/core/issues/250","id":103508847,"number":250,"title":"Improve API security","user":{"login":"tobscure","id":128862,"avatar_url":"https://avatars.githubusercontent.com/u/128862?v=3","gravatar_id":"","url":"https://api.github.com/users/tobscure","html_url":"https://github.com/tobscure","followers_url":"https://api.github.com/users/tobscure/followers","following_url":"https://api.github.com/users/tobscure/following{/other_user}","gists_url":"https://api.github.com/users/tobscure/gists{/gist_id}","starred_url":"https://api.github.com/users/tobscure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobscure/subscriptions","organizations_url":"https://api.github.com/users/tobscure/orgs","repos_url":"https://api.github.com/users/tobscure/repos","events_url":"https://api.github.com/users/tobscure/events{/privacy}","received_events_url":"https://api.github.com/users/tobscure/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flarum/core/labels/discussion","name":"discussion","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-27T13:27:38Z","updated_at":"2015-08-27T13:27:38Z","closed_at":null,"body":"Currently:\r\n\r\n* We expire API tokens after 1 hour\r\n* For tokens created by logging into Flarum's web app, we expire them after 14 days so that the user can be remembered via cookie\r\n* Logging out destroys all tokens\r\n\r\nI would like to discuss:\r\n\r\n* The benefits of adopting a spec like OAuth2 in our case (JavaScript app can't keep a secret), as opposed to our simple token system.\r\n* Implementing a \"sudo mode\" for sensitive actions like changing emails, and using any admin function (edit/delete user, admin CP, etc.) This would basically get the user to enter their password in order to obtain a privileged token that is expired after 30 mins.\r\n* Any other things we should do to improve security of the API."}}