Cypress: configure hardcoded user for api requests with cypress-ntlm-auth proxy

648 Views Asked by At

I'm using cypress-ntlm-auth plugin in my cypress automation project, providing me windows authentication (Ntlm, kerberos etc.)

In particular, I use the ntlmSso option for Negotiate with my app. If the server sends an authentication challenge, the ntlm-proxy will perform a NTLM or Negotiate login handshake with the credentials of the user running the test client.

The problem is that I need to use a pre-defined user (to be used in my pre-prod environment) to make api requests, instead of the logged on user on the computer.

How can I do that? thanks in advance

1

There are 1 best solutions below

0
agoff On

The cypress-ntlm-auth library allows you to specify this with cy.ntlm(), by passing in hosts, username, password, and domain.

cy.ntlm(["my.host.com"], "myUser", "myPass", "myDomain")

Check out the docs here. Take note of their strategy on storing passwords.