{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4883","repository_url":"https://api.github.com/repos/swagger-api/swagger-ui","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4883/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4883/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4883/events","html_url":"https://github.com/swagger-api/swagger-ui/issues/4883","id":360738616,"node_id":"MDU6SXNzdWUzNjA3Mzg2MTY=","number":4883,"title":"Add authorization header when loading swagger json end point","user":{"login":"MaklaCof","id":1589573,"node_id":"MDQ6VXNlcjE1ODk1NzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1589573?v=4","gravatar_id":"","url":"https://api.github.com/users/MaklaCof","html_url":"https://github.com/MaklaCof","followers_url":"https://api.github.com/users/MaklaCof/followers","following_url":"https://api.github.com/users/MaklaCof/following{/other_user}","gists_url":"https://api.github.com/users/MaklaCof/gists{/gist_id}","starred_url":"https://api.github.com/users/MaklaCof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaklaCof/subscriptions","organizations_url":"https://api.github.com/users/MaklaCof/orgs","repos_url":"https://api.github.com/users/MaklaCof/repos","events_url":"https://api.github.com/users/MaklaCof/events{/privacy}","received_events_url":"https://api.github.com/users/MaklaCof/received_events","type":"User","site_admin":false},"labels":[{"id":185046751,"node_id":"MDU6TGFiZWwxODUwNDY3NTE=","url":"https://api.github.com/repos/swagger-api/swagger-ui/labels/type:%20support","name":"type: support","color":"bfdadc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-17T06:36:22Z","updated_at":"2018-09-21T05:14:31Z","closed_at":"2018-09-21T05:14:31Z","author_association":"NONE","body":" ### Content & configuration\r\n```\r\nbuildTimestamp: \"Sat, 16 Jun 2018 07:51:13 GMT\"\r\ngitDirty: true\r\ngitRevision: \"g24faa46\"\r\nmachine: \"travis-job-311a007d-ebec-4b3c-bc7e-58ad5df1e1d8\"\r\nversion: \"3.17.1\"\r\n```\r\n\r\n### Is your feature request related to a problem?\r\nI would like to restrict access to APIs for unauthorised users in ASP.NET Core with Swashbuckle. I ask how to do it in [SO](https://stackoverflow.com/questions/52314366/add-request-jwt-token-header-when-loading-swagger-json-with-swashbuckle?noredirect=1#comment91610812_52314366), but I got response, that this is not possible.\r\n\r\n### Describe the solution you'd like\r\nSolution as I see it is that swagger-ui would also send authorization attribute when loading `swagger.json` (swagger end point) file, when user is logged in with `oauth2`.  \r\nThis shouldn't introduce any breaking changes and it is relatively easy to implement.\r\n\r\n### Describe alternatives you've considered\r\nI don't have any alternative suggestion. If I want to restrict access to API documentation, I need `authorization` header when loading `swagger.json`.\r\n\r\n### Additional context\r\nWhen different specification is set, 'authorization' header is also set in case when user is logged in.\r\n\r\n![chrome_2018-09-17_08-31-05](https://user-images.githubusercontent.com/1589573/45608586-0c3acf00-ba54-11e8-876a-b8d85195b5ed.png)\r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/comments/423415644","html_url":"https://github.com/swagger-api/swagger-ui/issues/4883#issuecomment-423415644","issue_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4883","id":423415644,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzQxNTY0NA==","user":{"login":"MaklaCof","id":1589573,"node_id":"MDQ6VXNlcjE1ODk1NzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1589573?v=4","gravatar_id":"","url":"https://api.github.com/users/MaklaCof","html_url":"https://github.com/MaklaCof","followers_url":"https://api.github.com/users/MaklaCof/followers","following_url":"https://api.github.com/users/MaklaCof/following{/other_user}","gists_url":"https://api.github.com/users/MaklaCof/gists{/gist_id}","starred_url":"https://api.github.com/users/MaklaCof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaklaCof/subscriptions","organizations_url":"https://api.github.com/users/MaklaCof/orgs","repos_url":"https://api.github.com/users/MaklaCof/repos","events_url":"https://api.github.com/users/MaklaCof/events{/privacy}","received_events_url":"https://api.github.com/users/MaklaCof/received_events","type":"User","site_admin":false},"created_at":"2018-09-21T05:14:31Z","updated_at":"2018-09-21T05:14:31Z","author_association":"NONE","body":"Hey @shockey.  \r\nIt looks it is a duplicate for #4325 not #4324.\r\n\r\nJust notice second point in GH-4334 . I think this is it."}}
{"actor":{"display_login":"MaklaCof"}}