SV-REという別のIIS7サーバーに対して、ASP.NetページからSV-REQというHttpWebRequestを作成しようとしています。 SV-RESでDigest、Basic、Negotiateを使用するようにIISを設定し、適切なメソッドを使用するために資格キャッシュオブジェクトに変更を加えると、コードは正常に実行され、SV-RESから有効な応答が得られ、は正しい。しかし、SV-RESで「Windows認証」を使用するようにIISを設定すると、資格キャッシュオブジェクトでNTLMを使用すると401エラーが返されます。NTLMを使用したHTTPS経由のHttpWebRequestが有効でない
私は本当に失われており、誰かがこの仕事をする方法についての情報を持っている場合は感謝します。
注:このコードが実行されているサーバーは、HTTP経由の匿名認証で実行されています。要求を受け取ったサーバーは、以下のコードで見られるように、HTTPSを介したNTLM(前述のように)です。
SV-REQ上で実行されているコードです。 SV-REQ IIS7であり、ここでASP.Net 2.0
Dim credCache As CredentialCache = New CredentialCache()
Dim mUri As Uri = New Uri("https://sv-res.my-domain-here.com/default.htm")
Dim mreq As HttpWebRequest = WebRequest.Create(mUri.ToString)
credCache.Add(mUri, "NTLM", New NetworkCredential(muser, mpass, mdomain))
mreq.Credentials = credCache
Dim mres As HttpWebResponse = mreq.GetResponse
するように構成されている、私は上記のコードからSV-RESから取り戻す誤差です。 SV-RESはASP.Net 2.0用IIS7用にも構成されています
The remote server returned an error: (401) Unauthorized. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The remote server returned an error: (401) Unauthorized. Source Error: Line 31: credCache.Add(mUri, "NTLM", New NetworkCredential(muser, mpass, mdomain)) Line 32: mreq.Credentials = credCache Line 33: Dim mres As HttpWebResponse = mreq.GetResponse Line 34: Dim sr As StreamReader = New StreamReader(mres.GetResponseStream()) Line 35: txtResult.Text = sr.ReadToEnd() Source File: C:\inetpub\httproot\contentscan.aspx.vb Line: 33 Stack Trace: [WebException: The remote server returned an error: (401) Unauthorized.] System.Net.HttpWebRequest.GetResponse() +1126 contentscan.Page_Load(Object sender, EventArgs e) in C:\inetpub\httproot\contentscan.aspx.vb:33 System.Web.UI.Control.OnLoad(EventArgs e) +132 System.Web.UI.Control.LoadRecursive() +66 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
わかりましたが、実際に送信している資格情報を持つユーザーを確認しましたか? –