More Articles in Websites > External Service Checks


Recent Knowledgebase Articles


Troubleshooting client-Side authentication

Problem

When adding a Service check, the first step fails, and a 401 unauthorized error is received. For example, you may see the following:

However, when you paste the URL into a browser, the destination page seems accessible and loads fine.

Cause

This can be caused by the client side target destination. The target site may perform an evaluation of the request and deny any that is is unable to identify the application type, operating system, or software vendor of. Confirm this using a cURL test to the same address:

ATX-TGUZMAN:Scripts timguzman$ curl -v https://www.dotcom.com
* Rebuilt URL to: https://www.dotcom.com
* Trying 12.345.67.890...
* TCP_NODELAY set
* Connected to dotcom.com (12.345.67.890) port 443 (#0)
* TLS 1.2 connection using TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
* Server certificate: *.dotcom.com
* Server certificate: thawte SHA256 SSL CA
* Server certificate: thawte Primary Root CA - G3
> GET / HTTP/1.1
> Host:www.dotcom.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Server: SecureTransport 5.2.1 (build: 2121)
< Features: CHPWD;RTCK;STCK;ASC;DNDISP
< Accept-Ranges: bytes
< X-Frame-Options: SAMEORIGIN
< Set-Cookie: FDX=1mujfhcll4xup17dwjbxv1wpmc;Path=/;Secure
< WWW-Authenticate: basic realm="Please enter username and password"
< Content-Type: text/html;charset=UTF-8
< Cache-Control: must-revalidate,no-cache,no-store
< Transfer-Encoding: chunked
<
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 401 Unauthorized</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /. Reason:
Unauthorized<br/>
<br/>

Solution

To resolve the issue, add the User-Agent header to the request, and enter the value of a common browser user-agent string. An example is provided here:

Save the step, then perform a test again to confirm the check passes.