{"action":"created","comment":{"url":"https://api.github.com/repos/openiddict/core/pulls/comments/42819315","id":42819315,"diff_hunk":"@@ -86,7 +88,37 @@ public class OpenIddictController<TUser, TApplication> : Controller where TUser\n                 });\n             }\n \n-            return View(\"Authorize\", Tuple.Create(request, await Manager.GetDisplayNameAsync(application)));\n+            // Get all scopes associated with the current application and ensure all scopes specified in the authorization request \n+            // belongs to the current application or fail with an error, note that we automatically strip out standard **openid** scopes.\n+            var requestedScopes = request.GetCustomScopes();\n+\n+            // Get all application scopes\n+            var applicationScopes = await Manager.GetScopesByApplicationAsync(application);\n+\n+            // Get all request scopes\n+            var requestScopes = await Manager.GetAuthorizationRequesteScopesAsync(requestedScopes);","path":"src/OpenIddict.Core/OpenIddictController.cs","position":41,"original_position":41,"commit_id":"d681d3e34be4e1497144a849f1d63c6e3fbaea9c","original_commit_id":"d681d3e34be4e1497144a849f1d63c6e3fbaea9c","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":"Curious: why do we need this method?","created_at":"2015-10-22T23:31:41Z","updated_at":"2015-10-22T23:31:41Z","html_url":"https://github.com/openiddict/core/pull/20#discussion_r42819315","pull_request_url":"https://api.github.com/repos/openiddict/core/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/openiddict/core/pulls/comments/42819315"},"html":{"href":"https://github.com/openiddict/core/pull/20#discussion_r42819315"},"pull_request":{"href":"https://api.github.com/repos/openiddict/core/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/openiddict/core/pulls/20","id":48525542,"html_url":"https://github.com/openiddict/core/pull/20","diff_url":"https://github.com/openiddict/core/pull/20.diff","patch_url":"https://github.com/openiddict/core/pull/20.patch","issue_url":"https://api.github.com/repos/openiddict/core/issues/20","number":20,"state":"open","locked":false,"title":"Do not merge - Scopes handling","user":{"login":"ilmax","id":3263338,"avatar_url":"https://avatars.githubusercontent.com/u/3263338?v=3","gravatar_id":"","url":"https://api.github.com/users/ilmax","html_url":"https://github.com/ilmax","followers_url":"https://api.github.com/users/ilmax/followers","following_url":"https://api.github.com/users/ilmax/following{/other_user}","gists_url":"https://api.github.com/users/ilmax/gists{/gist_id}","starred_url":"https://api.github.com/users/ilmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilmax/subscriptions","organizations_url":"https://api.github.com/users/ilmax/orgs","repos_url":"https://api.github.com/users/ilmax/repos","events_url":"https://api.github.com/users/ilmax/events{/privacy}","received_events_url":"https://api.github.com/users/ilmax/received_events","type":"User","site_admin":false},"body":"This is the first iteration of automatic scope handling, the code is still a WIP.\r\n/cc @PinpointTownes @Bartmax ","created_at":"2015-10-22T23:17:39Z","updated_at":"2015-10-22T23:31:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"922e861adcfd330c63f6ffa8faa1483b1cbf78d1","assignee":null,"milestone":{"url":"https://api.github.com/repos/openiddict/core/milestones/1","html_url":"https://github.com/openiddict/core/milestones/1.0.0-alpha1","labels_url":"https://api.github.com/repos/openiddict/core/milestones/1/labels","id":1336903,"number":1,"title":"1.0.0-alpha1","description":"","creator":{"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},"open_issues":12,"closed_issues":5,"state":"open","created_at":"2015-10-04T18:03:16Z","updated_at":"2015-10-22T23:18:14Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/openiddict/core/pulls/20/commits","review_comments_url":"https://api.github.com/repos/openiddict/core/pulls/20/comments","review_comment_url":"https://api.github.com/repos/openiddict/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openiddict/core/issues/20/comments","statuses_url":"https://api.github.com/repos/openiddict/core/statuses/d681d3e34be4e1497144a849f1d63c6e3fbaea9c","head":{"label":"ilmax:scopes_handling","ref":"scopes_handling","sha":"d681d3e34be4e1497144a849f1d63c6e3fbaea9c","user":{"login":"ilmax","id":3263338,"avatar_url":"https://avatars.githubusercontent.com/u/3263338?v=3","gravatar_id":"","url":"https://api.github.com/users/ilmax","html_url":"https://github.com/ilmax","followers_url":"https://api.github.com/users/ilmax/followers","following_url":"https://api.github.com/users/ilmax/following{/other_user}","gists_url":"https://api.github.com/users/ilmax/gists{/gist_id}","starred_url":"https://api.github.com/users/ilmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilmax/subscriptions","organizations_url":"https://api.github.com/users/ilmax/orgs","repos_url":"https://api.github.com/users/ilmax/repos","events_url":"https://api.github.com/users/ilmax/events{/privacy}","received_events_url":"https://api.github.com/users/ilmax/received_events","type":"User","site_admin":false},"repo":{"id":43677399,"name":"core","full_name":"ilmax/core","owner":{"login":"ilmax","id":3263338,"avatar_url":"https://avatars.githubusercontent.com/u/3263338?v=3","gravatar_id":"","url":"https://api.github.com/users/ilmax","html_url":"https://github.com/ilmax","followers_url":"https://api.github.com/users/ilmax/followers","following_url":"https://api.github.com/users/ilmax/following{/other_user}","gists_url":"https://api.github.com/users/ilmax/gists{/gist_id}","starred_url":"https://api.github.com/users/ilmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilmax/subscriptions","organizations_url":"https://api.github.com/users/ilmax/orgs","repos_url":"https://api.github.com/users/ilmax/repos","events_url":"https://api.github.com/users/ilmax/events{/privacy}","received_events_url":"https://api.github.com/users/ilmax/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilmax/core","description":"Easy-to-use OpenID Connect server for ASP.NET 5","fork":true,"url":"https://api.github.com/repos/ilmax/core","forks_url":"https://api.github.com/repos/ilmax/core/forks","keys_url":"https://api.github.com/repos/ilmax/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilmax/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilmax/core/teams","hooks_url":"https://api.github.com/repos/ilmax/core/hooks","issue_events_url":"https://api.github.com/repos/ilmax/core/issues/events{/number}","events_url":"https://api.github.com/repos/ilmax/core/events","assignees_url":"https://api.github.com/repos/ilmax/core/assignees{/user}","branches_url":"https://api.github.com/repos/ilmax/core/branches{/branch}","tags_url":"https://api.github.com/repos/ilmax/core/tags","blobs_url":"https://api.github.com/repos/ilmax/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilmax/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilmax/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilmax/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilmax/core/statuses/{sha}","languages_url":"https://api.github.com/repos/ilmax/core/languages","stargazers_url":"https://api.github.com/repos/ilmax/core/stargazers","contributors_url":"https://api.github.com/repos/ilmax/core/contributors","subscribers_url":"https://api.github.com/repos/ilmax/core/subscribers","subscription_url":"https://api.github.com/repos/ilmax/core/subscription","commits_url":"https://api.github.com/repos/ilmax/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilmax/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilmax/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilmax/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilmax/core/contents/{+path}","compare_url":"https://api.github.com/repos/ilmax/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilmax/core/merges","archive_url":"https://api.github.com/repos/ilmax/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilmax/core/downloads","issues_url":"https://api.github.com/repos/ilmax/core/issues{/number}","pulls_url":"https://api.github.com/repos/ilmax/core/pulls{/number}","milestones_url":"https://api.github.com/repos/ilmax/core/milestones{/number}","notifications_url":"https://api.github.com/repos/ilmax/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilmax/core/labels{/name}","releases_url":"https://api.github.com/repos/ilmax/core/releases{/id}","created_at":"2015-10-05T10:13:22Z","updated_at":"2015-10-05T13:44:58Z","pushed_at":"2015-10-22T23:15:55Z","git_url":"git://github.com/ilmax/core.git","ssh_url":"git@github.com:ilmax/core.git","clone_url":"https://github.com/ilmax/core.git","svn_url":"https://github.com/ilmax/core","homepage":"","size":2597,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"dev"}},"base":{"label":"openiddict:dev","ref":"dev","sha":"1bf5b97c79b0301bae7016367a3072babe3125fc","user":{"login":"openiddict","id":13908567,"avatar_url":"https://avatars.githubusercontent.com/u/13908567?v=3","gravatar_id":"","url":"https://api.github.com/users/openiddict","html_url":"https://github.com/openiddict","followers_url":"https://api.github.com/users/openiddict/followers","following_url":"https://api.github.com/users/openiddict/following{/other_user}","gists_url":"https://api.github.com/users/openiddict/gists{/gist_id}","starred_url":"https://api.github.com/users/openiddict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openiddict/subscriptions","organizations_url":"https://api.github.com/users/openiddict/orgs","repos_url":"https://api.github.com/users/openiddict/repos","events_url":"https://api.github.com/users/openiddict/events{/privacy}","received_events_url":"https://api.github.com/users/openiddict/received_events","type":"Organization","site_admin":false},"repo":{"id":41173335,"name":"core","full_name":"openiddict/core","owner":{"login":"openiddict","id":13908567,"avatar_url":"https://avatars.githubusercontent.com/u/13908567?v=3","gravatar_id":"","url":"https://api.github.com/users/openiddict","html_url":"https://github.com/openiddict","followers_url":"https://api.github.com/users/openiddict/followers","following_url":"https://api.github.com/users/openiddict/following{/other_user}","gists_url":"https://api.github.com/users/openiddict/gists{/gist_id}","starred_url":"https://api.github.com/users/openiddict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openiddict/subscriptions","organizations_url":"https://api.github.com/users/openiddict/orgs","repos_url":"https://api.github.com/users/openiddict/repos","events_url":"https://api.github.com/users/openiddict/events{/privacy}","received_events_url":"https://api.github.com/users/openiddict/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openiddict/core","description":"Easy-to-use OpenID Connect server for ASP.NET 5","fork":false,"url":"https://api.github.com/repos/openiddict/core","forks_url":"https://api.github.com/repos/openiddict/core/forks","keys_url":"https://api.github.com/repos/openiddict/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openiddict/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openiddict/core/teams","hooks_url":"https://api.github.com/repos/openiddict/core/hooks","issue_events_url":"https://api.github.com/repos/openiddict/core/issues/events{/number}","events_url":"https://api.github.com/repos/openiddict/core/events","assignees_url":"https://api.github.com/repos/openiddict/core/assignees{/user}","branches_url":"https://api.github.com/repos/openiddict/core/branches{/branch}","tags_url":"https://api.github.com/repos/openiddict/core/tags","blobs_url":"https://api.github.com/repos/openiddict/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openiddict/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openiddict/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/openiddict/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openiddict/core/statuses/{sha}","languages_url":"https://api.github.com/repos/openiddict/core/languages","stargazers_url":"https://api.github.com/repos/openiddict/core/stargazers","contributors_url":"https://api.github.com/repos/openiddict/core/contributors","subscribers_url":"https://api.github.com/repos/openiddict/core/subscribers","subscription_url":"https://api.github.com/repos/openiddict/core/subscription","commits_url":"https://api.github.com/repos/openiddict/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/openiddict/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/openiddict/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/openiddict/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/openiddict/core/contents/{+path}","compare_url":"https://api.github.com/repos/openiddict/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openiddict/core/merges","archive_url":"https://api.github.com/repos/openiddict/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openiddict/core/downloads","issues_url":"https://api.github.com/repos/openiddict/core/issues{/number}","pulls_url":"https://api.github.com/repos/openiddict/core/pulls{/number}","milestones_url":"https://api.github.com/repos/openiddict/core/milestones{/number}","notifications_url":"https://api.github.com/repos/openiddict/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openiddict/core/labels{/name}","releases_url":"https://api.github.com/repos/openiddict/core/releases{/id}","created_at":"2015-08-21T19:21:48Z","updated_at":"2015-10-21T08:19:47Z","pushed_at":"2015-10-22T23:17:39Z","git_url":"git://github.com/openiddict/core.git","ssh_url":"git@github.com:openiddict/core.git","clone_url":"https://github.com/openiddict/core.git","svn_url":"https://github.com/openiddict/core","homepage":"","size":2697,"stargazers_count":6,"watchers_count":6,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":14,"forks":3,"open_issues":14,"watchers":6,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/openiddict/core/pulls/20"},"html":{"href":"https://github.com/openiddict/core/pull/20"},"issue":{"href":"https://api.github.com/repos/openiddict/core/issues/20"},"comments":{"href":"https://api.github.com/repos/openiddict/core/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/openiddict/core/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/openiddict/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openiddict/core/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/openiddict/core/statuses/d681d3e34be4e1497144a849f1d63c6e3fbaea9c"}}}}