{"action":"created","issue":{"url":"https://api.github.com/repos/walkeriniraq/twitarr/issues/263","labels_url":"https://api.github.com/repos/walkeriniraq/twitarr/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/walkeriniraq/twitarr/issues/263/comments","events_url":"https://api.github.com/repos/walkeriniraq/twitarr/issues/263/events","html_url":"https://github.com/walkeriniraq/twitarr/issues/263","id":88580893,"number":263,"title":"User Validation Service","user":{"login":"WorldMaker","id":129777,"avatar_url":"https://avatars.githubusercontent.com/u/129777?v=3","gravatar_id":"","url":"https://api.github.com/users/WorldMaker","html_url":"https://github.com/WorldMaker","followers_url":"https://api.github.com/users/WorldMaker/followers","following_url":"https://api.github.com/users/WorldMaker/following{/other_user}","gists_url":"https://api.github.com/users/WorldMaker/gists{/gist_id}","starred_url":"https://api.github.com/users/WorldMaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WorldMaker/subscriptions","organizations_url":"https://api.github.com/users/WorldMaker/orgs","repos_url":"https://api.github.com/users/WorldMaker/repos","events_url":"https://api.github.com/users/WorldMaker/events{/privacy}","received_events_url":"https://api.github.com/users/WorldMaker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-16T01:06:24Z","updated_at":"2015-06-16T01:37:20Z","closed_at":null,"body":"As a developer of another JoCoCruise ecosystem web app, I would like an easy to use User Validation Service so that my users/players/Seamonkey compatriots can use one Twit-Arr login of convenience.\r\n\r\nNathan and I discussed this a bit today. Chat transcript for helpfulness (reformatted quick and dirty from Facebook Messenger into some semblance of simple Markdown):\r\n\r\n**Max:** Hey Nathan! Some questions regarding project \"dinghy\": It would make sense to share user db with Twit-arr, right? Would it just be a matter of expecting the right mongo collection? Any tips for working with it other than the obvious \"read the twit-arr source\"? If I need to add things to the User schema should I try to pr them back to twit-arr just in case they are useful? I guess there is an admin page in twit-arr they might be twiddled? Thanks!\r\n\r\n**Nathan:** Yes, PR for user changes\r\n\r\nI was thinking of putting a user validation service into Twitarr - we might have one already\r\n\r\nif not it's pretty easy to do\r\n\r\nNvm - we don't have a validation service - I'll add one though\r\n\r\nYou may want your own user objects though - assume a username that comes from the user auth service\r\n\r\nand then use that to key your user object off of\r\n\r\n**Max:** I was thinking a simple service to send out tweets might be handy too. There might be a couple cases were it would be cool to tweet something out in case it brings in interest from non-players. Maybe just use something like the Twitter messaging intent screen.\r\n\r\n**Nathan:** there is already an api for the CM app - could reuse most of that\r\n\r\n**Max:** Cool. I'll take a look at that if we get to a point for that kind of a \"stretch\" feature.\r\n\r\n**Nathan:** sounds good.  smile emoticon\r\n\r\n**Max:** It would be cool if the user auth service passed along the avatar image path. Also, I guess I need to figure out how I would bootstrap DMs/Admins from the validation service information.\r\n\r\nI guess it'd also be nice to have a simple test version of the validation service I can run without running the full Twit-Arr during development.\r\n\r\n**Nathan:** I can send back the avatar path. I think twitarr admins may be separate from the DMs\r\n\r\nI should be putting this into a ticket\r\n\r\n**Max:** I'm sure Twitarr Admin and DMs will be separate.\r\n\r\n**Nathan:**  So the way I've done this previously is to have you forward the users to a specially-formatted URL\r\n\r\n**Max:** That makes sense. Use a nonce/capability URL.\r\n\r\n**Nathan:** they'll log in with twit-arr credentials, and get redirected back to dinghy with a key appended to the url\r\n\r\nyou'll trade that key to the API for a user \"packet\" containing the username, avatar, and anything else you want\r\n\r\n(I hijacked that scheme from oauth)  smile emoticon\r\n\r\n**Max:** Yup, that sounds fair and familiar.\r\n\r\n**Nathan:** So for test purposes, you can either assume a user in the dev code (i.e. fake it) or build a fake auth service that returns static data\r\n\r\n**Max:** Looks like I'll get the excitement of trying to build a passport (node auth lib) plugin.\r\n\r\nAlthough I guess if you could go pure/true OAuth 2 or OAuth Connect I maybe could piggyback existing tools.\r\n\r\nAs much fun as those are to implement. tongue emoticon\r\n\r\n**Nathan:** Up to you - I didn't find it too difficult to build in rails - it was like 10 lines of code once I pulled in a  http library\r\n\r\n**Max:**  Could be worth a shot to see if we could leverage standard OAuth.\r\n\r\nYou are right, it does seem like the libraries are increasingly standard, and I guess that even includes running an idP in Ruby.\r\n\r\n(end scene)\r\n"},"comment":{"url":"https://api.github.com/repos/walkeriniraq/twitarr/issues/comments/112256456","html_url":"https://github.com/walkeriniraq/twitarr/issues/263#issuecomment-112256456","issue_url":"https://api.github.com/repos/walkeriniraq/twitarr/issues/263","id":112256456,"user":{"login":"Wingar","id":1838015,"avatar_url":"https://avatars.githubusercontent.com/u/1838015?v=3","gravatar_id":"","url":"https://api.github.com/users/Wingar","html_url":"https://github.com/Wingar","followers_url":"https://api.github.com/users/Wingar/followers","following_url":"https://api.github.com/users/Wingar/following{/other_user}","gists_url":"https://api.github.com/users/Wingar/gists{/gist_id}","starred_url":"https://api.github.com/users/Wingar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wingar/subscriptions","organizations_url":"https://api.github.com/users/Wingar/orgs","repos_url":"https://api.github.com/users/Wingar/repos","events_url":"https://api.github.com/users/Wingar/events{/privacy}","received_events_url":"https://api.github.com/users/Wingar/received_events","type":"User","site_admin":false},"created_at":"2015-06-16T01:37:20Z","updated_at":"2015-06-16T01:37:20Z","body":"We already have timed key system in place. Look at `/api/v2/user/auth`"}}