1

I am attempting to create some tests using RestSharp for a project I am working on.

This project uses Single Sign-on NTLM Authentication.

I am attemping to use a NTLMAuthenticator but my getUser request is always failing. I am not positive what URL to put in for the CredentialCache, the project or the SSO Id Provider.

            SharedRequests shared = new SharedRequests();
        var credential = new CredentialCache
        {
            {
                new Uri("project or ID Provider URL or something else?"),
                "NTLM",
                new NetworkCredential("doamin\Username", "Password")
            }
        };

        RestClient client = new RestClient();
        client.BaseUrl=new Uri("projectURL");
        client.Authenticator = new NtlmAuthenticator(credential);
        client.PreAuthenticate = true;
        RestRequest request = shared.GetCurrentUser();



        IRestResponse response = client.Execute(request);

my response always gets a 500 error which is what is expected when no auth cookies are present.

Drummondst
  • 13
  • 1
  • 6
  • add this line `request.UseDefaultCredentials = false;` before `response` variable and try it. – dev Sep 11 '18 at 16:43
  • @dev. No change in the response. I tried setting the credential uri to both the project url and ID provider. I am still getting a 500 error. – Drummondst Sep 25 '18 at 15:21

0 Answers0