How bypass a login popup in Synthetics?

I'm building a synthetic monitoring where I need login in this page to enter on the application:

But I can't interact with this pop up, because it is not page's part, it is a browser part.

So, I set a header to bypass it:

step("1- App Logon", async () => {

    const headers = {
      "Authorization": "Basic " + btoa(`${params.login}:${params.password}`),
    };

    page.setExtraHTTPHeaders(headers)
    await page.goto(params.url_orthanc, {waitUntil: 'domcontentloaded'}); 
    await page.locator('text=Welcome!').first().focus()
  });

this worked fine! but only in my pc :smiling_face_with_tear:

when I push it to Synthetics, I received a timeout error on this step.

I'm in same network's Synthetics.

Could You help me??

Hi @rafaeljsc,

Thanks for your interest in Synthetics!
When you mention that it's not working remotely, is this monitor running in a private location or in one our publicly hosted locations? If it's latter, I'd recommend opening a support request through Elastic Cloud portal so that we can more easily debug the problem.

Hi @emilioalvap !

the issue happens in a private location. How can I solve it in this instance?

Hi @rafaeljsc,

String interpolation is not currently supported on scripted monitors as it interferes with the generated policy, I'd suggest replacing them with string concatenation and testing again:

step("1- App Logon", async () => {

    const headers = {
      "Authorization": "Basic " + btoa(params.login + ":" + params.password),
    };

    page.setExtraHTTPHeaders(headers)
    await page.goto(params.url_orthanc, {waitUntil: 'domcontentloaded'}); 
    await page.locator('text=Welcome!').first().focus()
  });

same result...

I tried authenticate without a header too with this model:

https://username:password@hvv.pacs.rededor.com.br

And the same error happens: succeeded on my pc, but timeout on Synthetics.

If I pass only URL, without headers or parameters, I get an error 401: Unauthorized.

page.goto: net::ERR_INVALID_AUTH_CREDENTIALS at https://hvv.pacs.rededor.com.br/
   Call log:
     - navigating to "https://hvv.pacs.rededor.com.br/", waiting until "domcontentloaded"

Hi @rafaeljsc,

Do you ever get 401 Unauthorized from the monitor running in the private location? If that's not the case, can you test that it has network access to the endpoint (by issuing curl/wget)? Once network access has been discarded, we can look into more details.