# Python Script node: Proxy authentication issues

**URL:** <https://forum.knime.com/t/python-script-node-proxy-authentication-issues/79130>\
**Category:** KNIME Analytics Platform\
**Tags:** python\
**Created:** [May 13, 2024, 12:55pm UTC](https://forum.knime.com/t/python-script-node-proxy-authentication-issues/79130 "2024-05-13T12:55:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![koeties](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/ce7236/32.png) [@koeties](https://forum.knime.com/u/koeties)\
**Post date:** [May 13, 2024, 12:55pm UTC](https://forum.knime.com/t/python-script-node-proxy-authentication-issues/79130/1 "2024-05-13T12:55:08Z")

</div>

Hi

I’ve got a Python Script node that scrapes a data table from a website. I access the web from behind a corporate firewall that requires proxy authentication. I’ve got Knime Analytics installed on my Windows 10 machine. When I set it’s proxy as “Native” under preferences, Knime can look for -and download- updates etc. But for some reason I can’t get the python code to connect even if I set the request proxies parameter:  
r = requests.get(url, proxies={‘http’:‘[http://company.proxy.com](http://company.proxy.com):port’})

If I set Knime’s Proxy settings to “Manual” and specify the proxy details there, Knime will prompt me for my proxy username and password upon startup and then the Python script executes fine.

Is there a way to get the python script to use the Windows current user credentials to do the proxy authentication just like Knime does when using “Native” proxy configuration?

---

<div class="post-metadata">

**Author:** ![koeties](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/ce7236/32.png) [@koeties](https://forum.knime.com/u/koeties)\
**Post date:** [May 14, 2024, 6:38am UTC](https://forum.knime.com/t/python-script-node-proxy-authentication-issues/79130/2 "2024-05-14T06:38:40Z")

</div>

I finally figured out a way. The PyPac python module will auto-discover Windows proxy settings and do the proxy authentication pass-through as well:

from pypac import PACSession  
session = PACSession()  
html = session.get(‘[http://google.com](http://google.com)’).text

Now you don’t need to worry about any proxy settings in the Python Script node anymore.

---

<div class="post-metadata">

**Author:** ![steffen\_KNIME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/steffen_knime/32/33719_2.png) [@steffen\_KNIME](https://forum.knime.com/u/steffen_KNIME)\
**Post date:** [May 14, 2024, 9:32am UTC](https://forum.knime.com/t/python-script-node-proxy-authentication-issues/79130/3 "2024-05-14T09:32:39Z")

</div>

Hi @koeties,

thanks for that valid workaround! We also have a ticket to let the Python script node use the KNIME proxy settings (AP-22294) and will come back once we implemented that.

Best regards  
Steffen

---

<div class="post-metadata">

**Author:** ![koeties](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/ce7236/32.png) [@koeties](https://forum.knime.com/u/koeties)\
**Post date:** [May 14, 2024, 9:45am UTC](https://forum.knime.com/t/python-script-node-proxy-authentication-issues/79130/4 "2024-05-14T09:45:46Z")

</div>

Thanks for the feedback @steffen_KNIME.

Another question (maybe for another thread?) is that when I set my Knime proxy settings to “Native”, I can’t connect to the Knime Hub from within Knime. But as soon as I change it to manual and specify proxy details, I can connect. Maybe another thing to look into?

---

<div class="post-metadata">

**Author:** ![steffen\_KNIME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/steffen_knime/32/33719_2.png) [@steffen\_KNIME](https://forum.knime.com/u/steffen_KNIME)\
**Post date:** [May 14, 2024, 10:13am UTC](https://forum.knime.com/t/python-script-node-proxy-authentication-issues/79130/5 "2024-05-14T10:13:48Z")

</div>

Hi @koeties,

this bug is known and should be fixed in 5.2.3 and 5.3

Best regards  
Steffen

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [May 21, 2024, 10:14am UTC](https://forum.knime.com/t/python-script-node-proxy-authentication-issues/79130/6 "2024-05-21T10:14:26Z")

</div>

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