{"action":"opened","issue":{"url":"https://api.github.com/repos/Jumpscale/go-raml/issues/36","repository_url":"https://api.github.com/repos/Jumpscale/go-raml","labels_url":"https://api.github.com/repos/Jumpscale/go-raml/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/Jumpscale/go-raml/issues/36/comments","events_url":"https://api.github.com/repos/Jumpscale/go-raml/issues/36/events","html_url":"https://github.com/Jumpscale/go-raml/issues/36","id":140864374,"number":36,"title":"oauth2 support","user":{"login":"iwanbk","id":977552,"avatar_url":"https://avatars.githubusercontent.com/u/977552?v=3","gravatar_id":"","url":"https://api.github.com/users/iwanbk","html_url":"https://github.com/iwanbk","followers_url":"https://api.github.com/users/iwanbk/followers","following_url":"https://api.github.com/users/iwanbk/following{/other_user}","gists_url":"https://api.github.com/users/iwanbk/gists{/gist_id}","starred_url":"https://api.github.com/users/iwanbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwanbk/subscriptions","organizations_url":"https://api.github.com/users/iwanbk/orgs","repos_url":"https://api.github.com/users/iwanbk/repos","events_url":"https://api.github.com/users/iwanbk/events{/privacy}","received_events_url":"https://api.github.com/users/iwanbk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-15T03:51:09Z","updated_at":"2016-03-15T03:51:09Z","closed_at":null,"body":"@robvanmieghem @zaibon \r\nI am designing oauth 2 support now, i think we should implement it to follow the flow described in https://aaronparecki.com/2012/07/29/2/oauth2-simplified#web-server-apps.\r\nIf we choose Facebook as example, the flow would be:\r\n\r\n1. REST API server provide HTML login page with 'sign in with facebook' button.\r\n\r\n2. When user click the button, user will be redirected to facebook login page (`authorizationUri`)\r\n\r\n3. In succesfull login, user will be redirected back to REST server with access_code.\r\n\r\n4. With that access code, REST server can ask for access_token using URI specified in `accessTokenUri`\r\n\r\n5. REST server save access_token\r\n\r\n6. REST server give access_token as response to user.\r\n\r\nMost of the points are pretty clear, except point (5). I think redis is pretty common for this use case. But considering we also want to use mongodb in v0.3, it is worth to consider to use mongodb to save access_token data."}}