qmetry / qaf

Quality Automation Framework for web, mobileweb, mobile native and rest web-service using Selenium, webdrier, TestNG and Java Jersey
https://qmetry.github.io/qaf
MIT License
254 stars 138 forks source link

[HELP] JSON Request with NTLM Authentication #384

Closed reidleingod closed 3 years ago

reidleingod commented 3 years ago

Hello!

Need help making JSON requests work with NTLM authentication. We've been using Bearer Token auth type - which works fine - until we have this project that requires NTLM auth instead. I am not sure whether QAS supports JSON requests with NTLM auth but I have tried a lot of formats in the JSON file but no luck making it work. Or is there a correct format/approach? Here's the last request format I have tried with NTLM auth credentials: username, password, and domain:

{   
    "headers":
    {
        "Authorization":
        [
            {
                "username": "${msdynamics_username}",
                "password": "${msdynamics_password}",
            },
            {
                "domain": "${msdynamics_domain}"
            }
        ],
        "Content-Type":"application/json",
        "WWW-Authenticate": "Negotiate,NTLM",
        "Server": "Microsoft-HTTPAPI/2.0"
    },

    "endPoint": "",
    "baseUrl": "${msdynamics_url}/api/data/v8.2/contacts(mli_integrationkey='${clientNumberValue}')",
    "method": "PATCH",

    "body":
    {
        "mli_mcfuserid": ""
    }
}

Thanks in advance!

cjayswal commented 3 years ago

Try using NTLMAuthClient

rest.client.impl=com.qmetry.qaf.automation.ws.client.NTLMAuthClient

This is not right place for asking questions or seeking help. It is recommended to post questions with details in users group or in stack-overflow with qaf tag.

reidleingod commented 3 years ago

Oh, pardon @cjayswal .

Thank you for providing the links!