Help using NTLM authentication within the GET Request Node

I apologise if this is a bad question but I have been struggling to get the GET request to work properly and need some help. For some background I am trying to download a file from an API that is available within our cooperate network. There are two parts I need help with

  1. Authentication
    My postman get request works with NTLM authentication, but only if the automatic retries are enabled. After some packet inspection, it appears that there is a multi-stage handshake going on with some extra header included and it takes 3 requests to get authenticated before the API returns the request. My understanding is that this is part of NTLM protocol, but I am not sure.
    If postman is configured to use NTLM it works. But when in KNIME (Get Request) the NTLM (labs) option doesn’t work. Nor do any of the other options. I just get HTTP 401 errors. Even with the same credentials provided. I need help working out what is going on here and how I can fix it. I suspect its not doing the handshake/negotiation properly but I cannot see the requests KNIME is sending to know

  2. Automatic Windows Authentication
    Once we have that worked out I don’t want to have to provide credentials at all. I want KNIME to automatically use the credentials of the current user the same way a web browser does. (Or even doing the request via powershell can do this). It just needs to be normal windows authentication.
    My cooperate user account has access to the API I am trying to hit. But after setup, the KNIME workflow will be running as part of another application running on one of several servers (via command line), and we want it to use those service account’s credentials. How can I achieve this?

It may be that I need to do this a different way like using a java snippet or something. Any alternatives you suggest will also be appreciated. I can also provide more details if required. Just ask

(For background, I am a self taught programmer but I am new to web authentication so any explanations would be appreciated. Thanks in advance)

Update: I was not able to directly do what I mentioned but we found a workaround for anyone in future with a similar issue. Powershell can do invoke-Webrequest and can do windows authentication via -UseDefaultCredentials.

You can’t use powershell directly, however you can use python. So, we used the python integration extension and the python subprocess module to invoke these requests in a loop to download the files we needed. Then, in the same script we setup the flow variables required to give the workflow access to the files. This works really well and is far simpler than what I was originally attempting

2 Likes

Thanks for posting your workaround to benefit everyone :+1:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.