{"action":"created","issue":{"url":"https://api.github.com/repos/ServiceStack/Issues/issues/342","labels_url":"https://api.github.com/repos/ServiceStack/Issues/issues/342/labels{/name}","comments_url":"https://api.github.com/repos/ServiceStack/Issues/issues/342/comments","events_url":"https://api.github.com/repos/ServiceStack/Issues/issues/342/events","html_url":"https://github.com/ServiceStack/Issues/issues/342","id":103911500,"number":342,"title":"How to avoid HTTP 401 when ServiceStack server requires authorization?","user":{"login":"Leonidnei","id":14038982,"avatar_url":"https://avatars.githubusercontent.com/u/14038982?v=3","gravatar_id":"","url":"https://api.github.com/users/Leonidnei","html_url":"https://github.com/Leonidnei","followers_url":"https://api.github.com/users/Leonidnei/followers","following_url":"https://api.github.com/users/Leonidnei/following{/other_user}","gists_url":"https://api.github.com/users/Leonidnei/gists{/gist_id}","starred_url":"https://api.github.com/users/Leonidnei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leonidnei/subscriptions","organizations_url":"https://api.github.com/users/Leonidnei/orgs","repos_url":"https://api.github.com/users/Leonidnei/repos","events_url":"https://api.github.com/users/Leonidnei/events{/privacy}","received_events_url":"https://api.github.com/users/Leonidnei/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-30T09:34:51Z","updated_at":"2015-08-30T18:48:29Z","closed_at":"2015-08-30T18:48:29Z","body":"When server requires Windows authentication, each request sent by client is rejected with HTTP 401 and resent send time with auth headers, then the request succeeds.\r\n\r\nHow to avoid these double requests?\r\n\r\nFor WCF or ASMX service we can use:\r\nrequest.PreAuthenticate = true;\r\nrequest.UnsafeAuthenticatedConnectionSharing = true;\r\n\r\nwhere request is HttpRequest being sent to the server.\r\n\r\nHow to implement this with ServiceStack?"},"comment":{"url":"https://api.github.com/repos/ServiceStack/Issues/issues/comments/136174606","html_url":"https://github.com/ServiceStack/Issues/issues/342#issuecomment-136174606","issue_url":"https://api.github.com/repos/ServiceStack/Issues/issues/342","id":136174606,"user":{"login":"mythz","id":89361,"avatar_url":"https://avatars.githubusercontent.com/u/89361?v=3","gravatar_id":"","url":"https://api.github.com/users/mythz","html_url":"https://github.com/mythz","followers_url":"https://api.github.com/users/mythz/followers","following_url":"https://api.github.com/users/mythz/following{/other_user}","gists_url":"https://api.github.com/users/mythz/gists{/gist_id}","starred_url":"https://api.github.com/users/mythz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythz/subscriptions","organizations_url":"https://api.github.com/users/mythz/orgs","repos_url":"https://api.github.com/users/mythz/repos","events_url":"https://api.github.com/users/mythz/events{/privacy}","received_events_url":"https://api.github.com/users/mythz/received_events","type":"User","site_admin":false},"created_at":"2015-08-30T18:48:29Z","updated_at":"2015-08-30T18:48:29Z","body":"Hi, ServiceStack .NET Service Clients provides a thin wrapper over .NET's `HttpWebRequest` which you can modify with a global or local request filter, e.g:\r\n\r\n```csharp\r\nvar client = new JsonServiceClient(BaseUrl) {\r\n    RequestFilter = httpReq => {\r\n        httpReq.PreAuthenticate = true;\r\n        httpReq.UnsafeAuthenticatedConnectionSharing = true;\r\n    }\r\n};\r\n```\r\n\r\nPlease note this Issue Tracker is for reporting reproducible bugs/issues, please refer to [servicestack.net/account/support](https://servicestack.net/account/support) for your different support options, e.g. you can use [the Customer Forums](https://forums.servicestack.net/) or [StackOverflow](http://stackoverflow.com/questions/ask) for any general support/howto questions. "}}