{"action":"created","issue":{"url":"https://api.github.com/repos/ThreeMammals/Ocelot/issues/515","repository_url":"https://api.github.com/repos/ThreeMammals/Ocelot","labels_url":"https://api.github.com/repos/ThreeMammals/Ocelot/issues/515/labels{/name}","comments_url":"https://api.github.com/repos/ThreeMammals/Ocelot/issues/515/comments","events_url":"https://api.github.com/repos/ThreeMammals/Ocelot/issues/515/events","html_url":"https://github.com/ThreeMammals/Ocelot/issues/515","id":345979114,"node_id":"MDU6SXNzdWUzNDU5NzkxMTQ=","number":515,"title":"Administration API doesn't work","user":{"login":"Marusyk","id":9221694,"node_id":"MDQ6VXNlcjkyMjE2OTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/9221694?v=4","gravatar_id":"","url":"https://api.github.com/users/Marusyk","html_url":"https://github.com/Marusyk","followers_url":"https://api.github.com/users/Marusyk/followers","following_url":"https://api.github.com/users/Marusyk/following{/other_user}","gists_url":"https://api.github.com/users/Marusyk/gists{/gist_id}","starred_url":"https://api.github.com/users/Marusyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marusyk/subscriptions","organizations_url":"https://api.github.com/users/Marusyk/orgs","repos_url":"https://api.github.com/users/Marusyk/repos","events_url":"https://api.github.com/users/Marusyk/events{/privacy}","received_events_url":"https://api.github.com/users/Marusyk/received_events","type":"User","site_admin":false},"labels":[{"id":400545097,"node_id":"MDU6TGFiZWw0MDA1NDUwOTc=","url":"https://api.github.com/repos/ThreeMammals/Ocelot/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":26,"created_at":"2018-07-30T23:39:34Z","updated_at":"2018-09-07T06:58:05Z","closed_at":"2018-09-01T12:47:59Z","author_association":"NONE","body":"## Expected Behavior\r\nOverrwrites the existing configuration\r\n\r\n## Actual Behavior\r\nReturns 500 Internal Server Error\r\n\r\n> InvalidOperationException: Error parsing discovery document from http://localhost:5000/administration/.well-known/openid-configuration: Error connecting to http://localhost:5000/administration/.well-known/openid-configuration: No connection could be made because the target machine actively refused it\r\n\r\n## Steps to Reproduce the Problem\r\n\r\n  1. Read [docs](http://ocelot.readthedocs.io/en/latest/features/administration.html)\r\n  2. Download ocelot.postman_collection.json\r\n  3. In Startup.cs add `.AddAdministration(\"/administration\", \"secret\");`\r\n  4. Run service with api gateway: dotnet run: **Now listening on: http://localhost:55580**\r\n  5. Make POST to get token\r\n\r\n```\r\nPOST /administration/connect/token HTTP/1.1\r\nHost: localhost:55580\r\nCache-Control: no-cache\r\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\nadmin\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\nsecret\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\nadmin\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"grant_type\"\r\n\r\nclient_credentials\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--\r\n```\r\n  6. Make POST request to overrwrite the existing configuration\r\n```\r\n\r\nPOST /administration/configuration HTTP/1.1\r\nHost: localhost:55580\r\nAuthorization: Bearer pZWysp2fn03YLZV_3vejLGvLNvoyuYz3WTXyWcslaMay6oE3i95p1SxwcQ9FcYH4hp-8fqJ_H10WslPLV9KwmyBw2SsI2DoOrb8r0OXr5VZO_-E_SD3SjKyuh3NU05JTLHge_VtZV...\r\nContent-Type: application/json\r\nCache-Control: no-cache\r\n\r\n{\r\n\t\"ReRoutes\": [\r\n    {\r\n      \"ServiceName\" : \"templates\",\r\n      \"DownstreamPathTemplate\": \"/{everything}\",\r\n      \"DownstreamScheme\": \"http\",\r\n      \"DownstreamHostAndPorts\": [\r\n        {\r\n          \"Host\": \"localhost\",\r\n          \"Port\": 50689\r\n        }\r\n      ],\r\n      \"UpstreamPathTemplate\": \"/templates/{everything}\",\r\n      \"UpstreamHttpMethod\": [ \"GET\" ]\r\n    }\r\n  ],\r\n  \"GlobalConfiguration\": {\r\n    \"RequestIdKey\": \"Request-Id\"\r\n  }\r\n}\r\n```\r\nReturns 500 Internal Server Error\r\n\r\n> InvalidOperationException: Error parsing discovery document from http://localhost:5000/administration/.well-known/openid-configuration: Error connecting to http://localhost:5000/administration/.well-known/openid-configuration: No connection could be made because the target machine actively refused it\r\n\r\n  7. Make POST request to http://localhost:55580/administration/.well-known/openid-configuration\r\n\r\n```\r\nGET /administration/.well-known/openid-configuration HTTP/1.1\r\nHost: localhost:55580\r\nAuthorization: Bearer pZWysp2fn03YLZV_3vejLGvLNvoyuYz3WTXyWcslaMay6oE3i95p1SxwcQ9FcYH4hp-8fqJ_H10WslPLV9KwmyBw2SsI2DoOrb8r0OXr5VZO_-E_SD3SjKyuh3NU05JTLHge_VtZV...\r\nCache-Control: no-cache\r\n```\r\n\r\nReturns\r\n\r\n> InvalidOperationException: Policy error while contacting the discovery endpoint http://localhost:5000/administration/.well-known/openid-configuration: Issuer name does not match authority: Ocelot\r\n\r\n## Specifications\r\n\r\n  - Version: 8.0.0\r\n  - Platform: Windows 10\r\n  - Subsystem: netcoreapp2.1\r\n"},"comment":{"url":"https://api.github.com/repos/ThreeMammals/Ocelot/issues/comments/419342455","html_url":"https://github.com/ThreeMammals/Ocelot/issues/515#issuecomment-419342455","issue_url":"https://api.github.com/repos/ThreeMammals/Ocelot/issues/515","id":419342455,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTM0MjQ1NQ==","user":{"login":"TomPallister","id":5716716,"node_id":"MDQ6VXNlcjU3MTY3MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/5716716?v=4","gravatar_id":"","url":"https://api.github.com/users/TomPallister","html_url":"https://github.com/TomPallister","followers_url":"https://api.github.com/users/TomPallister/followers","following_url":"https://api.github.com/users/TomPallister/following{/other_user}","gists_url":"https://api.github.com/users/TomPallister/gists{/gist_id}","starred_url":"https://api.github.com/users/TomPallister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomPallister/subscriptions","organizations_url":"https://api.github.com/users/TomPallister/orgs","repos_url":"https://api.github.com/users/TomPallister/repos","events_url":"https://api.github.com/users/TomPallister/events{/privacy}","received_events_url":"https://api.github.com/users/TomPallister/received_events","type":"User","site_admin":false},"created_at":"2018-09-07T06:58:05Z","updated_at":"2018-09-07T06:58:05Z","author_association":"MEMBER","body":"@Marusyk which file on disk are you checking?\r\n\r\nOcelot won't change your appsettings.json (I noticed you use this to load the configuration). It will create an ocelot.{env}.json file on disk and use this as like a datastore.\r\n\r\nYou can get your initial configuration into Ocelot using appsettings.json because it just uses .net options API but after this all the other features need to write to file and it cant write to appsettings. I guess this isn't very clear. Maybe I could change the builder to UseConfiguration(\"path-user-chooses-for-config-file) so this is way more explicit."}}
{"actor":{"display_login":"TomPallister"}}