{"action":"created","issue":{"url":"https://api.github.com/repos/gravitee-io/issues/issues/1397","repository_url":"https://api.github.com/repos/gravitee-io/issues","labels_url":"https://api.github.com/repos/gravitee-io/issues/issues/1397/labels{/name}","comments_url":"https://api.github.com/repos/gravitee-io/issues/issues/1397/comments","events_url":"https://api.github.com/repos/gravitee-io/issues/issues/1397/events","html_url":"https://github.com/gravitee-io/issues/issues/1397","id":341945223,"node_id":"MDU6SXNzdWUzNDE5NDUyMjM=","number":1397,"title":"[gateway] Internal error when trying to access an API with multiple plans","user":{"login":"hqrd","id":22975382,"node_id":"MDQ6VXNlcjIyOTc1Mzgy","avatar_url":"https://avatars1.githubusercontent.com/u/22975382?v=4","gravatar_id":"","url":"https://api.github.com/users/hqrd","html_url":"https://github.com/hqrd","followers_url":"https://api.github.com/users/hqrd/followers","following_url":"https://api.github.com/users/hqrd/following{/other_user}","gists_url":"https://api.github.com/users/hqrd/gists{/gist_id}","starred_url":"https://api.github.com/users/hqrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hqrd/subscriptions","organizations_url":"https://api.github.com/users/hqrd/orgs","repos_url":"https://api.github.com/users/hqrd/repos","events_url":"https://api.github.com/users/hqrd/events{/privacy}","received_events_url":"https://api.github.com/users/hqrd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-07-17T14:30:06Z","updated_at":"2018-07-18T09:23:27Z","closed_at":null,"author_association":"NONE","body":"### Context\r\nI deployed an API with 2 plans attached to it. Each of those plans is using a separate OAuth2 resource and a specific scope.\r\nPlan1 is using resource oauth1 with required scope : scope1\r\nPlan2 is using resource oauth2 with required scope : scope2\r\nEach resource has its own clientId and clientSecret, on the same access management.\r\n\r\n### Expected Behavior\r\nEach plan should work independently, when accessing the API with a scope1 token, I should access it via plan1. Same for a token with the scope2.\r\n\r\n### Current Behavior\r\nI'm getting a 500 internal error when calling the api with a token scope1 or scope2.\r\nSee : https://gist.github.com/hqrd/475c3a86413561c2c3bb717fde8bd215\r\n\r\nI recreated the 2 plans, and I get `Bearer realm=\"gravitee.io\", error=\"insufficient_scope\", error_description=\"The request requires higher privileges than provided by the access token.\"` using the scope2, while the scope1 works. :confused: \r\n\r\n### Steps to Reproduce (for bugs)\r\n1. Create 2 plans using OAuth2 and use a different resource and scope (step2 of plan creation).\r\n2. Subscribe to the plans as a user, \r\n3. Generate the tokens and make an api call from each tokens\r\n\r\n\r\n### Your Environment\r\nnginx:1.12.1-alpine\r\ngraviteeio/am-webui:1.6.4\r\ngraviteeio/am-gateway:1.6.4\r\nmongo:3.4\r\ngraviteeio/gateway:1.17.0\r\ngraviteeio/management-api:1.17.0\r\ngraviteeio/management-ui:1.17.0\r\nmongo:3.4\r\ndocker.elastic.co/elasticsearch/elasticsearch:5.4.3\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/gravitee-io/issues/issues/comments/405868447","html_url":"https://github.com/gravitee-io/issues/issues/1397#issuecomment-405868447","issue_url":"https://api.github.com/repos/gravitee-io/issues/issues/1397","id":405868447,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTg2ODQ0Nw==","user":{"login":"brasseld","id":133094,"node_id":"MDQ6VXNlcjEzMzA5NA==","avatar_url":"https://avatars3.githubusercontent.com/u/133094?v=4","gravatar_id":"","url":"https://api.github.com/users/brasseld","html_url":"https://github.com/brasseld","followers_url":"https://api.github.com/users/brasseld/followers","following_url":"https://api.github.com/users/brasseld/following{/other_user}","gists_url":"https://api.github.com/users/brasseld/gists{/gist_id}","starred_url":"https://api.github.com/users/brasseld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brasseld/subscriptions","organizations_url":"https://api.github.com/users/brasseld/orgs","repos_url":"https://api.github.com/users/brasseld/repos","events_url":"https://api.github.com/users/brasseld/events{/privacy}","received_events_url":"https://api.github.com/users/brasseld/received_events","type":"User","site_admin":false},"created_at":"2018-07-18T09:23:27Z","updated_at":"2018-07-18T09:23:27Z","author_association":"MEMBER","body":"ok, so you just have to create a single resource, put oauth2 client credentials for the API gateway and then create 2 plans with limited access using scopes."}}
{"actor":{"display_login":"brasseld"}}