0

How process NTLM authentication in Unity3d with UnityWebRequest.

I try this code (but always get response code 401):

private IEnumerator Test(string url)
{
    UnityWebRequest webRequest = UnityWebRequest.Head(url);
    var logPass = "login:password";
    webRequest.SetRequestHeader("AUTHORIZATION", "Basic " + System.Text.Encoding.ASCII.GetBytes(logPass));

    yield return webRequest.Send();

    Debug.Log("xxx webRequest.responseCode " + webRequest.responseCode);
}

Please any help!!!

Knaus Irina
  • 789
  • 5
  • 15
  • 35
  • Actually, that error is normal and part of the protocol. See [this](https://blogs.msdn.microsoft.com/chiranth/2013/09/20/ntlm-want-to-know-how-it-works/) and [this](https://www.innovation.ch/personal/ronald/ntlm.html) for how it works and how to implement it. By the way, it is a Get request not Head. – Programmer Nov 16 '17 at 12:20
  • I think that UnityWebRequest encapsulates requests – Knaus Irina Nov 16 '17 at 14:39

0 Answers0