bjowes / cypress-ntlm-auth

Windows authentication plugin for Cypress
MIT License
55 stars 10 forks source link

Safer ntlmReset #114

Closed bjowes closed 3 years ago

bjowes commented 4 years ago

The cy.ntlmReset terminates all sockets to ensure no pre-authenticated sessions still exist. Recent versions of cypress seems to get confused by this. I have managed to work around it by navigating to a blank page, forcing the browser to drop all connections.

To simplify this for the users, the cy.ntlmReset should go to a blank page before terminating sockets. The blank page could be returned by ntlm-proxy when a specific url (or header) is requested. embedded Possibly this should be optional, there might be cases where the user would not want to navigate away on ntlmReset.

bjowes commented 3 years ago

This has been resolved by improving the way the ntlm-proxy closes connections on reset.

bjowes commented 3 years ago

Implemented in 3.0.0

sebgamby commented 2 years ago

Sorry for the delay in answering. I use indeed '*' in the cy.ntlm(...). I have tested the version 4.0.4 and it works. Thanks a lot! I was forced to have two features for some requirements, I will be able to merge them and have a clean one on relation in my traceability matrix.

For information only (this is not an issue for me): if I do not use the ntlmReset(), the test is stuck with the identity obtained with the first cy.ntlm(...). Here is a screenshot for a test execution without the reset. The 3 first scenarios have a step to set dummy0 as user, the last one has a step to use dummy1. As you can see this last scenario fails because the identity is still dummy0. With the reset, this test passes.

bjowes commented 2 years ago

Glad it helped. Thanks for reporting this - I think it could also be related to the wildcard host. For a named host it should clear all connections on reconfiguration, likely there is an issue with matching with wildcard host.

sebgamby commented 2 years ago

I have made a test by without the wildcard. I have used cy.ntlm(['localhost:44365'], Cypress.env('dummy0Login'), Cypress.env('dummy0Password'), 'prod.fsma.be') and I got the same result than above.