{"action":"created","issue":{"url":"https://api.github.com/repos/DoSomething/gladiator/issues/12","repository_url":"https://api.github.com/repos/DoSomething/gladiator","labels_url":"https://api.github.com/repos/DoSomething/gladiator/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/DoSomething/gladiator/issues/12/comments","events_url":"https://api.github.com/repos/DoSomething/gladiator/issues/12/events","html_url":"https://github.com/DoSomething/gladiator/pull/12","id":134958098,"number":12,"title":"Authentication via Northstar.","user":{"login":"weerd","id":105849,"avatar_url":"https://avatars.githubusercontent.com/u/105849?v=3","gravatar_id":"","url":"https://api.github.com/users/weerd","html_url":"https://github.com/weerd","followers_url":"https://api.github.com/users/weerd/followers","following_url":"https://api.github.com/users/weerd/following{/other_user}","gists_url":"https://api.github.com/users/weerd/gists{/gist_id}","starred_url":"https://api.github.com/users/weerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weerd/subscriptions","organizations_url":"https://api.github.com/users/weerd/orgs","repos_url":"https://api.github.com/users/weerd/repos","events_url":"https://api.github.com/users/weerd/events{/privacy}","received_events_url":"https://api.github.com/users/weerd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"angaither","id":645205,"avatar_url":"https://avatars.githubusercontent.com/u/645205?v=3","gravatar_id":"","url":"https://api.github.com/users/angaither","html_url":"https://github.com/angaither","followers_url":"https://api.github.com/users/angaither/followers","following_url":"https://api.github.com/users/angaither/following{/other_user}","gists_url":"https://api.github.com/users/angaither/gists{/gist_id}","starred_url":"https://api.github.com/users/angaither/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angaither/subscriptions","organizations_url":"https://api.github.com/users/angaither/orgs","repos_url":"https://api.github.com/users/angaither/repos","events_url":"https://api.github.com/users/angaither/events{/privacy}","received_events_url":"https://api.github.com/users/angaither/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-02-19T19:55:23Z","updated_at":"2016-02-24T21:53:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DoSomething/gladiator/pulls/12","html_url":"https://github.com/DoSomething/gladiator/pull/12","diff_url":"https://github.com/DoSomething/gladiator/pull/12.diff","patch_url":"https://github.com/DoSomething/gladiator/pull/12.patch"},"body":"# WORK IN PROGRESS\r\n\r\n#### What's this PR do?\r\nThis PR enables authentication for Gladiator via Northstar API. Only users that have a role of `admin` or `staff` can access authenticated routes. This also creates the login view to allow authorized users to login. \r\n\r\n#### Where should the reviewer start?\r\nProbably start in the **AuthServiceProvider.php** then head to the **GladiatorUserProvider.php** etc. Checkout the **routes.php** too. There's a lot of stuff... I apologize ahead of time :grimacing: \r\n\r\n#### How should this be manually tested?\r\nYou definitely need to update your **.env** to now include:\r\n```\r\nNORTHSTAR_URI=https://northstar.dosomething.org\r\nNORTHSTAR_API_KEY=GrabTheKeyFromAurora\r\n```\r\nYou can then use the artisan console command to add yourself as a user to the database and attempt to login:\r\n\r\n```\r\n$ php artisan add:user username@dosomething.org --role=admin\r\n```\r\n\r\n#### Any background context you want to provide?\r\nMake sure to run the following commands if testing this branch or once this branch is merged:\r\n```\r\n$ composer dump-autoload\r\n$ php artisan clear-compiled\r\n```\r\n\r\nI still need to populate the message bag to give proper validation errors if a user can't login for whatever reason. There's a couple smaller updates coming in a later PR, just didn't want this one to get too massive.\r\n\r\n#### What are the relevant tickets?\r\nFixes #3 \r\n\r\n#### Screenshots (if appropriate)\r\nThis PR also adds a convenient artisan command called `add:user` which allows you to create a new user with a role of `admin` or `staff` (\"staff\" is the default if none is specified). These users are first verified as DoSomething users on Northstar before they are added via a specified email:\r\n\r\n```\r\n$ php artisan add:user dlorenzo@dosomething.org --role=admin\r\n```\r\n\r\n<img width=\"717\" alt=\"screen shot 2016-02-24 at 2 08 28 am\" src=\"https://cloud.githubusercontent.com/assets/105849/13292017/189660b4-dae8-11e5-99ee-a08da0b4ad6d.png\">\r\n\r\nIt checks to make sure they are in Northstar and user isn't already in the Gladiator database.\r\n\r\nThis will help with local development when you need to authenticate into the app, and also when we deploy to production, we could have an artisan command run on initial deploy to officially add new admin and staff users that can automatically begin using the site from the [\"gecko\"](http://www.urbandictionary.com/define.php?term=from+the+gecko)\r\n\r\n---\r\n@angaither @sbsmith86 @deadlybutter \r\n\r\ncc: @DFurnes "},"comment":{"url":"https://api.github.com/repos/DoSomething/gladiator/issues/comments/188468853","html_url":"https://github.com/DoSomething/gladiator/pull/12#issuecomment-188468853","issue_url":"https://api.github.com/repos/DoSomething/gladiator/issues/12","id":188468853,"user":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T21:53:28Z","updated_at":"2016-02-24T21:53:28Z","body":"@weerd Hmm, yeah I guess if you remove the `admin` and `user` scopes from the key we could do that. I'd still vote for QA just so we can have the credentials in the `.env.example` like @deadlybutter suggested above."}}