{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/comments/174487806","pull_request_review_id":103853163,"id":174487806,"diff_hunk":"@@ -0,0 +1,68 @@\n+var express = require('express');\n+var path = require('path');\n+var logger = require('morgan');\n+var session = require('express-session');\n+var passport = require('passport');\n+var Auth0Strategy = require('passport-auth0-openidconnect').Strategy;\n+\n+var config = require('./config');\n+var routes = require('./routes');\n+\n+// This will configure Passport to use Auth0\n+const strategy = new Auth0Strategy(\n+  config.auth0,\n+  ((req, issuer, audience, profile, accessToken, refreshToken, params, callback) => {","path":"app/app.js","position":14,"original_position":14,"commit_id":"b9058ec5f8f40215afff2f88292ad830f7d126ee","original_commit_id":"b9058ec5f8f40215afff2f88292ad830f7d126ee","user":{"login":"xoen","id":238563,"avatar_url":"https://avatars0.githubusercontent.com/u/238563?v=4","gravatar_id":"","url":"https://api.github.com/users/xoen","html_url":"https://github.com/xoen","followers_url":"https://api.github.com/users/xoen/followers","following_url":"https://api.github.com/users/xoen/following{/other_user}","gists_url":"https://api.github.com/users/xoen/gists{/gist_id}","starred_url":"https://api.github.com/users/xoen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xoen/subscriptions","organizations_url":"https://api.github.com/users/xoen/orgs","repos_url":"https://api.github.com/users/xoen/repos","events_url":"https://api.github.com/users/xoen/events{/privacy}","received_events_url":"https://api.github.com/users/xoen/received_events","type":"User","site_admin":false},"body":"I think that was the weird problem we had if you remember.\r\nEven when not setting anything in the session explicitly here that `passReqToCallback` seems to be necessary - I'll give it another quick try but we tried last time and it wan't working without that set to `true`.\r\n\r\nMy theory was that if request is not passed back will not have cookie and therefore will not create user session - I don't know express enough to tell to be honest.","created_at":"2018-03-14T14:55:03Z","updated_at":"2018-03-14T14:55:03Z","html_url":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy/pull/1#discussion_r174487806","pull_request_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/comments/174487806"},"html":{"href":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy/pull/1#discussion_r174487806"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/1"}},"in_reply_to_id":174425495},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/1","id":174745792,"html_url":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy/pull/1","diff_url":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy/pull/1.diff","patch_url":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy/pull/1.patch","issue_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/issues/1","number":1,"state":"open","locked":false,"title":"Use Auth0 hosted login page and enable SSO","user":{"login":"xoen","id":238563,"avatar_url":"https://avatars0.githubusercontent.com/u/238563?v=4","gravatar_id":"","url":"https://api.github.com/users/xoen","html_url":"https://github.com/xoen","followers_url":"https://api.github.com/users/xoen/followers","following_url":"https://api.github.com/users/xoen/following{/other_user}","gists_url":"https://api.github.com/users/xoen/gists{/gist_id}","starred_url":"https://api.github.com/users/xoen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xoen/subscriptions","organizations_url":"https://api.github.com/users/xoen/orgs","repos_url":"https://api.github.com/users/xoen/repos","events_url":"https://api.github.com/users/xoen/events{/privacy}","received_events_url":"https://api.github.com/users/xoen/received_events","type":"User","site_admin":false},"body":"### What\r\n- Main aim of this is to start using Auth0 hosted login page instead of custom login page.\r\n- I also enabled Silent SSO so that user is not bothered to login when they're already logged in central SSO.\r\n- Updated `/logout` endpoint to log user out also from central SSO (relies on new environment variable `APP_HOST`)\r\n\r\n### Why\r\nBecause Auth0 Lock.js < 11 are deprecated and will stop working on 1st April.\r\n\r\n### Other changes\r\nI also tidied up few things as I was in here:\r\n- Expire session cookies after 1 hour\r\n- Added proper `/healthz` healtcheck endpoint\r\n- Switched to `passport-auth0-openidconnect` (from `passport-auth0`)\r\n- Bumped all dependencies\r\n- Removed all templates and assets and related dependencies (`pug`, `uglify-js`)\r\n- Removed more unused dependencies:\r\n  - `cookie-parser`, not required since `express-session` 1.5.0\r\n  - `body-parser`, not used as we don't touch the requests body\r\n  - `serve-favicon`, not used as we proxy these requests\r\n- Started to use `dotenv` (was already a dependency but not used)\r\n- Updated `Dockerfile to use Node.js 8.9.4 (LTS)\r\n- Moved configuration to `config.js`\r\n- Improved project structure a bit\r\n\r\n### Ticket\r\nhttps://trello.com/c/robNgbzG/651-3-update-kibana-auth-proxy-to-use-hosted-auth0-login","created_at":"2018-03-13T18:10:05Z","updated_at":"2018-03-14T14:55:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3033a067963216988326da752bf17d1159b7903","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/issues/1/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/statuses/b9058ec5f8f40215afff2f88292ad830f7d126ee","head":{"label":"ministryofjustice:ag--hosted-login-page","ref":"ag--hosted-login-page","sha":"b9058ec5f8f40215afff2f88292ad830f7d126ee","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":98989941,"name":"analytics-platform-kibana-auth-proxy","full_name":"ministryofjustice/analytics-platform-kibana-auth-proxy","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy","description":"Auth0 auth proxy for Kibana","fork":false,"url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy","forks_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/forks","keys_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/events","assignees_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/merges","archive_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/deployments","created_at":"2017-08-01T10:34:43Z","updated_at":"2017-08-01T10:34:59Z","pushed_at":"2018-03-13T18:10:06Z","git_url":"git://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy.git","ssh_url":"git@github.com:ministryofjustice/analytics-platform-kibana-auth-proxy.git","clone_url":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy.git","svn_url":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy","homepage":null,"size":52,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"0a99bb7e53b389b961af691e0d8912974a5d0b23","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":98989941,"name":"analytics-platform-kibana-auth-proxy","full_name":"ministryofjustice/analytics-platform-kibana-auth-proxy","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy","description":"Auth0 auth proxy for Kibana","fork":false,"url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy","forks_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/forks","keys_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/events","assignees_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/merges","archive_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/deployments","created_at":"2017-08-01T10:34:43Z","updated_at":"2017-08-01T10:34:59Z","pushed_at":"2018-03-13T18:10:06Z","git_url":"git://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy.git","ssh_url":"git@github.com:ministryofjustice/analytics-platform-kibana-auth-proxy.git","clone_url":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy.git","svn_url":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy","homepage":null,"size":52,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/1"},"html":{"href":"https://github.com/ministryofjustice/analytics-platform-kibana-auth-proxy/pull/1"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/issues/1"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-kibana-auth-proxy/statuses/b9058ec5f8f40215afff2f88292ad830f7d126ee"}},"author_association":"NONE"}}
{"actor":{"display_login":"xoen"}}