{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/AuthSamples/pulls/comments/185887193","pull_request_review_id":117368124,"id":185887193,"diff_hunk":"@@ -0,0 +1,10 @@\n+AuthSamples.Options.MultiTenant\n+=================\n+\n+Sample demonstrating dynamic authentication schemes and options:\n+1. Run the app, the Home page will show all the authentication schemes.\n+2. You can add new schemes via the form at the bottom, and remove any via the Remove button.\n+3. You can also update any of the scheme options message via the add/update form.\n+\n+Index.cshtml and Controllers/AuthController.cs are the most interesting classes in the sample,\n+as they demonstrate how to add/remove schemes and update the corresponding named options dynamically.","path":"samples/Options.MultiTenant/README.md","position":10,"original_position":10,"commit_id":"55f582560e42c9cd893c839993246232e2b35781","original_commit_id":"55f582560e42c9cd893c839993246232e2b35781","user":{"login":"HaoK","id":6537861,"avatar_url":"https://avatars2.githubusercontent.com/u/6537861?v=4","gravatar_id":"","url":"https://api.github.com/users/HaoK","html_url":"https://github.com/HaoK","followers_url":"https://api.github.com/users/HaoK/followers","following_url":"https://api.github.com/users/HaoK/following{/other_user}","gists_url":"https://api.github.com/users/HaoK/gists{/gist_id}","starred_url":"https://api.github.com/users/HaoK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaoK/subscriptions","organizations_url":"https://api.github.com/users/HaoK/orgs","repos_url":"https://api.github.com/users/HaoK/repos","events_url":"https://api.github.com/users/HaoK/events{/privacy}","received_events_url":"https://api.github.com/users/HaoK/received_events","type":"User","site_admin":false},"body":"Yeah i still need to update the readmes","created_at":"2018-05-03T17:56:56Z","updated_at":"2018-05-03T17:56:57Z","html_url":"https://github.com/aspnet/AuthSamples/pull/44#discussion_r185887193","pull_request_url":"https://api.github.com/repos/aspnet/AuthSamples/pulls/44","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/aspnet/AuthSamples/pulls/comments/185887193"},"html":{"href":"https://github.com/aspnet/AuthSamples/pull/44#discussion_r185887193"},"pull_request":{"href":"https://api.github.com/repos/aspnet/AuthSamples/pulls/44"}},"in_reply_to_id":185880520},"pull_request":{"url":"https://api.github.com/repos/aspnet/AuthSamples/pulls/44","id":185314731,"html_url":"https://github.com/aspnet/AuthSamples/pull/44","diff_url":"https://github.com/aspnet/AuthSamples/pull/44.diff","patch_url":"https://github.com/aspnet/AuthSamples/pull/44.patch","issue_url":"https://api.github.com/repos/aspnet/AuthSamples/issues/44","number":44,"state":"open","locked":false,"title":"[Prototype] Add multitenant version of dynamic schemes sample","user":{"login":"HaoK","id":6537861,"avatar_url":"https://avatars2.githubusercontent.com/u/6537861?v=4","gravatar_id":"","url":"https://api.github.com/users/HaoK","html_url":"https://github.com/HaoK","followers_url":"https://api.github.com/users/HaoK/followers","following_url":"https://api.github.com/users/HaoK/following{/other_user}","gists_url":"https://api.github.com/users/HaoK/gists{/gist_id}","starred_url":"https://api.github.com/users/HaoK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaoK/subscriptions","organizations_url":"https://api.github.com/users/HaoK/orgs","repos_url":"https://api.github.com/users/HaoK/repos","events_url":"https://api.github.com/users/HaoK/events{/privacy}","received_events_url":"https://api.github.com/users/HaoK/received_events","type":"User","site_admin":false},"body":"So early cut of the multi-tenant + auth options sample.\r\n\r\nI took the existing dynamic schemes samples and made it work for different tenants, I just used a lame \r\n?tenant=id query string to simulate different tenants.  \r\n\r\nThe sample has adds these services:\r\n```\r\n            // Just returns the tenant id\r\n            services.AddSingleton<TenantResolver>();\r\n\r\n            // Basically adds a layer of tenant to named options dictionary\r\n            services.AddSingleton<IOptionsMonitor<SimpleOptions>, TenantOptionsMonitor>();\r\n\r\n            // These are needed to be able to add/remove schemes and also update their options\r\n            services.AddSingleton<IAuthenticationSchemeProvider, TenantSchemeResolver>();\r\n            services.AddSingleton<TenantOptionsCache>();\r\n```\r\n\r\nThe result is each tenant has its own set of authentication schemes and options configurations, and can be updated dynamically using /?tenant=id\r\n\r\nThoughts @Tratcher @davidfowl @blowdart ","created_at":"2018-05-02T01:28:09Z","updated_at":"2018-05-03T17:56:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"346707b8cdfd711ab54af8ccdbc7dc5e10e6273f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/AuthSamples/pulls/44/commits","review_comments_url":"https://api.github.com/repos/aspnet/AuthSamples/pulls/44/comments","review_comment_url":"https://api.github.com/repos/aspnet/AuthSamples/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/AuthSamples/issues/44/comments","statuses_url":"https://api.github.com/repos/aspnet/AuthSamples/statuses/55f582560e42c9cd893c839993246232e2b35781","head":{"label":"aspnet:haok/options","ref":"haok/options","sha":"55f582560e42c9cd893c839993246232e2b35781","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":108468483,"name":"AuthSamples","full_name":"aspnet/AuthSamples","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/AuthSamples","description":"Samples for ASP.NET Core authentication and authorization","fork":false,"url":"https://api.github.com/repos/aspnet/AuthSamples","forks_url":"https://api.github.com/repos/aspnet/AuthSamples/forks","keys_url":"https://api.github.com/repos/aspnet/AuthSamples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/AuthSamples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/AuthSamples/teams","hooks_url":"https://api.github.com/repos/aspnet/AuthSamples/hooks","issue_events_url":"https://api.github.com/repos/aspnet/AuthSamples/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/AuthSamples/events","assignees_url":"https://api.github.com/repos/aspnet/AuthSamples/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/AuthSamples/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/AuthSamples/tags","blobs_url":"https://api.github.com/repos/aspnet/AuthSamples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/AuthSamples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/AuthSamples/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/AuthSamples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/AuthSamples/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/AuthSamples/languages","stargazers_url":"https://api.github.com/repos/aspnet/AuthSamples/stargazers","contributors_url":"https://api.github.com/repos/aspnet/AuthSamples/contributors","subscribers_url":"https://api.github.com/repos/aspnet/AuthSamples/subscribers","subscription_url":"https://api.github.com/repos/aspnet/AuthSamples/subscription","commits_url":"https://api.github.com/repos/aspnet/AuthSamples/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/AuthSamples/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/AuthSamples/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/AuthSamples/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/AuthSamples/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/AuthSamples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/AuthSamples/merges","archive_url":"https://api.github.com/repos/aspnet/AuthSamples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/AuthSamples/downloads","issues_url":"https://api.github.com/repos/aspnet/AuthSamples/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/AuthSamples/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/AuthSamples/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/AuthSamples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/AuthSamples/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/AuthSamples/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/AuthSamples/deployments","created_at":"2017-10-26T21:40:24Z","updated_at":"2018-05-03T11:54:18Z","pushed_at":"2018-05-02T01:28:10Z","git_url":"git://github.com/aspnet/AuthSamples.git","ssh_url":"git@github.com:aspnet/AuthSamples.git","clone_url":"https://github.com/aspnet/AuthSamples.git","svn_url":"https://github.com/aspnet/AuthSamples","homepage":null,"size":724,"stargazers_count":33,"watchers_count":33,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":12,"open_issues":16,"watchers":33,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"a941f3c7128668f0bed60ea86ab3a47e9428f38b","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":108468483,"name":"AuthSamples","full_name":"aspnet/AuthSamples","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/AuthSamples","description":"Samples for ASP.NET Core authentication and authorization","fork":false,"url":"https://api.github.com/repos/aspnet/AuthSamples","forks_url":"https://api.github.com/repos/aspnet/AuthSamples/forks","keys_url":"https://api.github.com/repos/aspnet/AuthSamples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/AuthSamples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/AuthSamples/teams","hooks_url":"https://api.github.com/repos/aspnet/AuthSamples/hooks","issue_events_url":"https://api.github.com/repos/aspnet/AuthSamples/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/AuthSamples/events","assignees_url":"https://api.github.com/repos/aspnet/AuthSamples/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/AuthSamples/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/AuthSamples/tags","blobs_url":"https://api.github.com/repos/aspnet/AuthSamples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/AuthSamples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/AuthSamples/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/AuthSamples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/AuthSamples/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/AuthSamples/languages","stargazers_url":"https://api.github.com/repos/aspnet/AuthSamples/stargazers","contributors_url":"https://api.github.com/repos/aspnet/AuthSamples/contributors","subscribers_url":"https://api.github.com/repos/aspnet/AuthSamples/subscribers","subscription_url":"https://api.github.com/repos/aspnet/AuthSamples/subscription","commits_url":"https://api.github.com/repos/aspnet/AuthSamples/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/AuthSamples/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/AuthSamples/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/AuthSamples/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/AuthSamples/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/AuthSamples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/AuthSamples/merges","archive_url":"https://api.github.com/repos/aspnet/AuthSamples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/AuthSamples/downloads","issues_url":"https://api.github.com/repos/aspnet/AuthSamples/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/AuthSamples/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/AuthSamples/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/AuthSamples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/AuthSamples/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/AuthSamples/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/AuthSamples/deployments","created_at":"2017-10-26T21:40:24Z","updated_at":"2018-05-03T11:54:18Z","pushed_at":"2018-05-02T01:28:10Z","git_url":"git://github.com/aspnet/AuthSamples.git","ssh_url":"git@github.com:aspnet/AuthSamples.git","clone_url":"https://github.com/aspnet/AuthSamples.git","svn_url":"https://github.com/aspnet/AuthSamples","homepage":null,"size":724,"stargazers_count":33,"watchers_count":33,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":12,"open_issues":16,"watchers":33,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/AuthSamples/pulls/44"},"html":{"href":"https://github.com/aspnet/AuthSamples/pull/44"},"issue":{"href":"https://api.github.com/repos/aspnet/AuthSamples/issues/44"},"comments":{"href":"https://api.github.com/repos/aspnet/AuthSamples/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/AuthSamples/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/AuthSamples/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/AuthSamples/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/AuthSamples/statuses/55f582560e42c9cd893c839993246232e2b35781"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"HaoK"}}