Note that there are some explanatory texts on larger screens.

plurals
  1. PO401 Unauthorized returned on EndGetResponse. Apache Error log: cannot generate context
    primarykey
    data
    text
    <p>I got a server with Apache running. Now I want to be able to read the contents of a folder there and for that this folder is configured in the Apache httpd.conf something like this:</p> <pre><code>Alias /folder "E:/Folder" &lt;Directory "E:/Folder"&gt; AuthName "Public Folder" AuthType SSPI SSPIAuth On SSPIAuthoritative On SSPIDomain DOMAIN SSPIOfferBasic On SSPIOfferSSPI On SSPIBasicPreferred Off SSPIOmitDomain On SSPIUsernameCase lower require group "DOMAIN\Domain Users" &lt;/Directory&gt; </code></pre> <p>Now when I use a Browser I can already access this Information with the URL <a href="http://ServerName/Folder/" rel="nofollow">http://ServerName/Folder/</a></p> <p>So this workes just fine already. But now I am trying to receive this Folder-Data for my C# application. I am using DefaultNetworkCredentials and my Code looks something like this:</p> <pre><code>public void CheckFolder() { WebRequest request = HttpWebRequest.Create(_uri); request.Credentials = CredentialCache.DefaultNetworkCredentials; request.BeginGetResponse(new AsyncCallback(HandleGetAvailableUpdates), request); } void HandleGetAvailableUpdates(IAsyncResult state) { try { if (state.IsCompleted) { WebRequest req = state.AsyncState as WebRequest; WebResponse response = req.EndGetResponse(state); Stream wStream = null; wStream = response.GetResponseStream(); byte[] data = new byte[response.ContentLength]; etc. . . . } catch (WebException ex) { Console.WriteLine(ex.ToString()); } } } </code></pre> <p>req.EndGetResponse(state) now throws the WebException:</p> <pre><code>The remote server returned an error: (401) Unauthorized. </code></pre> <p>Going back on Server-Side I have a look at the Apache error.log and there I find:</p> <pre><code>(OS 87)The parameter is incorrect. : authentication failure for "/folder": user unknown, reason: cannot generate context </code></pre> <p>This feature of the Program already worked well about two month ago. The C#-Code did not change at all but I dont know if something had been done with the server or the Apache configuration. I also tried to give my Credentials (username and pw, the same I use when accessing via Web-Browser) manually in the C#-Code rather than using the DefaultNetworkCredentials but with no avail. So finally my question would be: Is there something I forgot? Are there any other settings on the server to be made to make it work?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload