{"action":"closed","number":293,"pull_request":{"url":"https://api.github.com/repos/aspnet/Security/pulls/293","id":38246983,"html_url":"https://github.com/aspnet/Security/pull/293","diff_url":"https://github.com/aspnet/Security/pull/293.diff","patch_url":"https://github.com/aspnet/Security/pull/293.patch","issue_url":"https://api.github.com/repos/aspnet/Security/issues/293","number":293,"state":"closed","locked":false,"title":"Replace INonceCache by IDistributedCache","user":{"login":"PinpointTownes","id":6998306,"avatar_url":"https://avatars.githubusercontent.com/u/6998306?v=3","gravatar_id":"","url":"https://api.github.com/users/PinpointTownes","html_url":"https://github.com/PinpointTownes","followers_url":"https://api.github.com/users/PinpointTownes/followers","following_url":"https://api.github.com/users/PinpointTownes/following{/other_user}","gists_url":"https://api.github.com/users/PinpointTownes/gists{/gist_id}","starred_url":"https://api.github.com/users/PinpointTownes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PinpointTownes/subscriptions","organizations_url":"https://api.github.com/users/PinpointTownes/orgs","repos_url":"https://api.github.com/users/PinpointTownes/repos","events_url":"https://api.github.com/users/PinpointTownes/events{/privacy}","received_events_url":"https://api.github.com/users/PinpointTownes/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/aspnet/Security/issues/212.\r\n\r\nFor the first attempt, I opted for the \"hybrid\" approach (https://github.com/aspnet/Security/issues/212#issuecomment-112533342): the distributed cache is retrieved from the options when available, and from the DI container when the user didn't provide his own cache.\r\n\r\nStoring nonces in the distributed cache is not enabled by default but can easily be using `StoreNoncesInCache`. I'm not super satisfied with the name, so don't hesitate to suggest another one :smile: \r\n\r\nFYI, I haven't been able to use the `OpenIdConnectSample` app because it delegates authentication to AAD, that doesn't allow me to log in using my live.com account. I worked around this issue using `AspNet.Security.OpenIdConnect.Server` (https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server).\r\n\r\nOf course, I'll revert these changes before merging (though depending on AAD is not really a good idea IMHO).\r\n\r\n![image](https://cloud.githubusercontent.com/assets/6998306/8285735/90843b96-1905-11e5-813b-7c82d5eae4a7.png)\r\n\r\n/cc @Eilon @HaoK @Tratcher","created_at":"2015-06-22T15:57:15Z","updated_at":"2015-06-29T16:40:48Z","closed_at":"2015-06-29T16:40:48Z","merged_at":"2015-06-29T16:40:48Z","merge_commit_sha":"ea6cf8f9a3e0ea6dd990b75906a1910ce10f4e69","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Security/pulls/293/commits","review_comments_url":"https://api.github.com/repos/aspnet/Security/pulls/293/comments","review_comment_url":"https://api.github.com/repos/aspnet/Security/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Security/issues/293/comments","statuses_url":"https://api.github.com/repos/aspnet/Security/statuses/102f113e2bba7193af949829506051633e640ff8","head":{"label":"PinpointTownes:nonce","ref":"nonce","sha":"102f113e2bba7193af949829506051633e640ff8","user":{"login":"PinpointTownes","id":6998306,"avatar_url":"https://avatars.githubusercontent.com/u/6998306?v=3","gravatar_id":"","url":"https://api.github.com/users/PinpointTownes","html_url":"https://github.com/PinpointTownes","followers_url":"https://api.github.com/users/PinpointTownes/followers","following_url":"https://api.github.com/users/PinpointTownes/following{/other_user}","gists_url":"https://api.github.com/users/PinpointTownes/gists{/gist_id}","starred_url":"https://api.github.com/users/PinpointTownes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PinpointTownes/subscriptions","organizations_url":"https://api.github.com/users/PinpointTownes/orgs","repos_url":"https://api.github.com/users/PinpointTownes/repos","events_url":"https://api.github.com/users/PinpointTownes/events{/privacy}","received_events_url":"https://api.github.com/users/PinpointTownes/received_events","type":"User","site_admin":false},"repo":{"id":30196509,"name":"Security","full_name":"PinpointTownes/Security","owner":{"login":"PinpointTownes","id":6998306,"avatar_url":"https://avatars.githubusercontent.com/u/6998306?v=3","gravatar_id":"","url":"https://api.github.com/users/PinpointTownes","html_url":"https://github.com/PinpointTownes","followers_url":"https://api.github.com/users/PinpointTownes/followers","following_url":"https://api.github.com/users/PinpointTownes/following{/other_user}","gists_url":"https://api.github.com/users/PinpointTownes/gists{/gist_id}","starred_url":"https://api.github.com/users/PinpointTownes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PinpointTownes/subscriptions","organizations_url":"https://api.github.com/users/PinpointTownes/orgs","repos_url":"https://api.github.com/users/PinpointTownes/repos","events_url":"https://api.github.com/users/PinpointTownes/events{/privacy}","received_events_url":"https://api.github.com/users/PinpointTownes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PinpointTownes/Security","description":"Middleware for security and authorization of web apps.","fork":true,"url":"https://api.github.com/repos/PinpointTownes/Security","forks_url":"https://api.github.com/repos/PinpointTownes/Security/forks","keys_url":"https://api.github.com/repos/PinpointTownes/Security/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PinpointTownes/Security/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PinpointTownes/Security/teams","hooks_url":"https://api.github.com/repos/PinpointTownes/Security/hooks","issue_events_url":"https://api.github.com/repos/PinpointTownes/Security/issues/events{/number}","events_url":"https://api.github.com/repos/PinpointTownes/Security/events","assignees_url":"https://api.github.com/repos/PinpointTownes/Security/assignees{/user}","branches_url":"https://api.github.com/repos/PinpointTownes/Security/branches{/branch}","tags_url":"https://api.github.com/repos/PinpointTownes/Security/tags","blobs_url":"https://api.github.com/repos/PinpointTownes/Security/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PinpointTownes/Security/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PinpointTownes/Security/git/refs{/sha}","trees_url":"https://api.github.com/repos/PinpointTownes/Security/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PinpointTownes/Security/statuses/{sha}","languages_url":"https://api.github.com/repos/PinpointTownes/Security/languages","stargazers_url":"https://api.github.com/repos/PinpointTownes/Security/stargazers","contributors_url":"https://api.github.com/repos/PinpointTownes/Security/contributors","subscribers_url":"https://api.github.com/repos/PinpointTownes/Security/subscribers","subscription_url":"https://api.github.com/repos/PinpointTownes/Security/subscription","commits_url":"https://api.github.com/repos/PinpointTownes/Security/commits{/sha}","git_commits_url":"https://api.github.com/repos/PinpointTownes/Security/git/commits{/sha}","comments_url":"https://api.github.com/repos/PinpointTownes/Security/comments{/number}","issue_comment_url":"https://api.github.com/repos/PinpointTownes/Security/issues/comments{/number}","contents_url":"https://api.github.com/repos/PinpointTownes/Security/contents/{+path}","compare_url":"https://api.github.com/repos/PinpointTownes/Security/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PinpointTownes/Security/merges","archive_url":"https://api.github.com/repos/PinpointTownes/Security/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PinpointTownes/Security/downloads","issues_url":"https://api.github.com/repos/PinpointTownes/Security/issues{/number}","pulls_url":"https://api.github.com/repos/PinpointTownes/Security/pulls{/number}","milestones_url":"https://api.github.com/repos/PinpointTownes/Security/milestones{/number}","notifications_url":"https://api.github.com/repos/PinpointTownes/Security/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PinpointTownes/Security/labels{/name}","releases_url":"https://api.github.com/repos/PinpointTownes/Security/releases{/id}","created_at":"2015-02-02T16:36:08Z","updated_at":"2015-04-18T16:42:37Z","pushed_at":"2015-06-26T23:09:22Z","git_url":"git://github.com/PinpointTownes/Security.git","ssh_url":"git@github.com:PinpointTownes/Security.git","clone_url":"https://github.com/PinpointTownes/Security.git","svn_url":"https://github.com/PinpointTownes/Security","homepage":"","size":1575,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"6ae37717e819b047b10421e997e9704601d9fbd9","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","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":17723699,"name":"Security","full_name":"aspnet/Security","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","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/Security","description":"Middleware for security and authorization of web apps.","fork":false,"url":"https://api.github.com/repos/aspnet/Security","forks_url":"https://api.github.com/repos/aspnet/Security/forks","keys_url":"https://api.github.com/repos/aspnet/Security/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Security/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Security/teams","hooks_url":"https://api.github.com/repos/aspnet/Security/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Security/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Security/events","assignees_url":"https://api.github.com/repos/aspnet/Security/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Security/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Security/tags","blobs_url":"https://api.github.com/repos/aspnet/Security/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Security/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Security/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Security/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Security/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Security/languages","stargazers_url":"https://api.github.com/repos/aspnet/Security/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Security/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Security/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Security/subscription","commits_url":"https://api.github.com/repos/aspnet/Security/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Security/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Security/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Security/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Security/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Security/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Security/merges","archive_url":"https://api.github.com/repos/aspnet/Security/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Security/downloads","issues_url":"https://api.github.com/repos/aspnet/Security/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Security/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Security/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Security/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Security/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Security/releases{/id}","created_at":"2014-03-13T19:44:34Z","updated_at":"2015-06-29T12:27:58Z","pushed_at":"2015-06-29T16:40:47Z","git_url":"git://github.com/aspnet/Security.git","ssh_url":"git@github.com:aspnet/Security.git","clone_url":"https://github.com/aspnet/Security.git","svn_url":"https://github.com/aspnet/Security","homepage":"","size":4947,"stargazers_count":156,"watchers_count":156,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":51,"forks":68,"open_issues":51,"watchers":156,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Security/pulls/293"},"html":{"href":"https://github.com/aspnet/Security/pull/293"},"issue":{"href":"https://api.github.com/repos/aspnet/Security/issues/293"},"comments":{"href":"https://api.github.com/repos/aspnet/Security/issues/293/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Security/pulls/293/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Security/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Security/pulls/293/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Security/statuses/102f113e2bba7193af949829506051633e640ff8"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"Tratcher","id":1821173,"avatar_url":"https://avatars.githubusercontent.com/u/1821173?v=3","gravatar_id":"","url":"https://api.github.com/users/Tratcher","html_url":"https://github.com/Tratcher","followers_url":"https://api.github.com/users/Tratcher/followers","following_url":"https://api.github.com/users/Tratcher/following{/other_user}","gists_url":"https://api.github.com/users/Tratcher/gists{/gist_id}","starred_url":"https://api.github.com/users/Tratcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tratcher/subscriptions","organizations_url":"https://api.github.com/users/Tratcher/orgs","repos_url":"https://api.github.com/users/Tratcher/repos","events_url":"https://api.github.com/users/Tratcher/events{/privacy}","received_events_url":"https://api.github.com/users/Tratcher/received_events","type":"User","site_admin":false},"comments":6,"review_comments":33,"commits":1,"additions":49,"deletions":18,"changed_files":8}}