{"action":"created","issue":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/352","repository_url":"https://api.github.com/repos/IdentityServer/IdentityServer4","labels_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/352/labels{/name}","comments_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/352/comments","events_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/352/events","html_url":"https://github.com/IdentityServer/IdentityServer4/issues/352","id":179717690,"number":352,"title":"Authorization Policy with JWT Token and Identity Server 4","user":{"login":"abdelkaderbenabdi","id":22321414,"avatar_url":"https://avatars.githubusercontent.com/u/22321414?v=3","gravatar_id":"","url":"https://api.github.com/users/abdelkaderbenabdi","html_url":"https://github.com/abdelkaderbenabdi","followers_url":"https://api.github.com/users/abdelkaderbenabdi/followers","following_url":"https://api.github.com/users/abdelkaderbenabdi/following{/other_user}","gists_url":"https://api.github.com/users/abdelkaderbenabdi/gists{/gist_id}","starred_url":"https://api.github.com/users/abdelkaderbenabdi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abdelkaderbenabdi/subscriptions","organizations_url":"https://api.github.com/users/abdelkaderbenabdi/orgs","repos_url":"https://api.github.com/users/abdelkaderbenabdi/repos","events_url":"https://api.github.com/users/abdelkaderbenabdi/events{/privacy}","received_events_url":"https://api.github.com/users/abdelkaderbenabdi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-28T09:03:56Z","updated_at":"2016-09-28T09:27:13Z","closed_at":null,"body":"I'm using Identity Server 4 for authenticating users from Angular 2 App and asp.net core. I'm declaring an authorization Policy on the asp.net core application so only some roles can access some api.\r\n\r\nservices.AddAuthorization(options =>\r\n            {\r\n                options.AddPolicy(\"AdminOnly\", policyAdmin =>\r\n                {\r\n                    policyAdmin.RequireClaim(\"role\", \"Admin\");\r\n                });\r\n            });\r\n\r\nand adding the Jwt bearer authentication like this on the asp.net core app :\r\napp.UseJwtBearerAuthentication(options);\r\n\r\nSo after authenticating with identity server 4, I receive an access token. this access token is used in angular 2 http header. but the asp.net core app never authorize the user for admin role even if I have the role claim in the access token.\r\n\r\nIs there any configuration to add to the asp.net core app?"},"comment":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/comments/250117329","html_url":"https://github.com/IdentityServer/IdentityServer4/issues/352#issuecomment-250117329","issue_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/352","id":250117329,"user":{"login":"abdelkaderbenabdi","id":22321414,"avatar_url":"https://avatars.githubusercontent.com/u/22321414?v=3","gravatar_id":"","url":"https://api.github.com/users/abdelkaderbenabdi","html_url":"https://github.com/abdelkaderbenabdi","followers_url":"https://api.github.com/users/abdelkaderbenabdi/followers","following_url":"https://api.github.com/users/abdelkaderbenabdi/following{/other_user}","gists_url":"https://api.github.com/users/abdelkaderbenabdi/gists{/gist_id}","starred_url":"https://api.github.com/users/abdelkaderbenabdi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abdelkaderbenabdi/subscriptions","organizations_url":"https://api.github.com/users/abdelkaderbenabdi/orgs","repos_url":"https://api.github.com/users/abdelkaderbenabdi/repos","events_url":"https://api.github.com/users/abdelkaderbenabdi/events{/privacy}","received_events_url":"https://api.github.com/users/abdelkaderbenabdi/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T09:27:13Z","updated_at":"2016-09-28T09:27:13Z","body":"Hi @damienbod,\r\n\r\nYes I added the authorize attribute on the controller:\r\n[Authorize(\"AdminOnly\")]\r\n\r\nI followed your article and the only difference is that I'm using Asp.net Core identity with mongodb as user store."}}
{"actor":{"display_login":"abdelkaderbenabdi"}}