bjowes / cypress-ntlm-auth

Windows authentication plugin for Cypress
MIT License
54 stars 9 forks source link

How to use this plugin for just back-end requests. #248

Closed EEO27 closed 3 months ago

EEO27 commented 4 months ago

Hi!

First of all I really want to thank you for this plugin. It works very nice!

I am using you plugin to sent API requests tot the back-end so I can setup testdata in CRM(ms dynamics365)

If I understand it correctly, you plugin is launching its proxy which monitors all the network trafic from cypress to the specific host.

Because of this montoring proxy I still have problem with accessing the frontend in the ACC environment with Cypress.

I am wondering the following:

Should it be possible to not run the ntlm-proxy continuously?

So that Cypress can access the Frontend in the ACC environment. And I only use the ntlm-handshake just when I use the POST api request to setup testdata in the back-end?

bjowes commented 4 months ago

Thanks @EEO27 - I'm glad that it is useful!

It is not possible to turn the ntlm-proxy on and off during runtime. cypress is bootstrapped to pass all its traffic through the proxy, and this cannot be changed without restarting cypress.

Generally it should not be an issue though, all non NTLM traffic is just passed through the proxy. If it is https traffic, a tunneling socket is setup, so ntlm-proxy does not even see the traffic except for opening and closing connections.

Could you explain how the frontend access fails in more detail? Could it be the case that your backend APIs are reachable inside your intranet, while the frontend is hosted externally (cloud)? Combining that scenario with a corporate proxy could mean that it works for the backend but the frontend requires additional configuration to handle the corporate proxy.